@box/metadata-editor 0.92.2 → 0.92.4
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/chunks/metadata-instance-form-card-wrapper.js +1 -1
- package/chunks/taxonomy-ancestor-status-pill.js +34 -35
- package/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +5 -5
- package/esm/lib/components/add-metadata-template-dropdown/messages.js +1 -1
- package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +39 -40
- package/esm/lib/components/combobox-with-api-pagination/messages.js +1 -1
- package/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +1 -1
- package/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +6 -6
- package/esm/lib/components/filter-dropdown-menu/messages.js +1 -1
- package/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +7 -7
- package/esm/lib/components/filter-instances-dropdown/messages.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +15 -16
- package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +27 -28
- package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +6 -6
- package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +5 -5
- package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +9 -9
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +5 -5
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +1 -1
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +1 -1
- package/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +70 -567
- package/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +18 -19
- package/esm/lib/components/metadata-empty-state/messages.js +1 -1
- package/esm/lib/components/metadata-empty-state/metadata-empty-state.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +10 -10
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +14 -15
- package/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +2 -2
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +1 -1
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +14 -14
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +5 -5
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +3 -3
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +3 -4
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +1 -1
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +1 -1
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +1 -1
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +1 -1
- package/esm/lib/components/unsaved-changes-modal/messages.js +1 -1
- package/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +18 -19
- package/esm/lib/messages.js +1 -1
- package/package.json +2 -2
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +1 -1
- package/chunks/index.js +0 -292
- package/chunks/message.js +0 -18
@@ -1,13 +1,12 @@
|
|
1
|
-
import { Select as
|
1
|
+
import { Select as l, SELECT_EMPTY_VALUE as r } from "@box/blueprint-web";
|
2
2
|
import { useFormikContext as C, getIn as L, Field as P } from "formik";
|
3
3
|
import { forwardRef as $ } from "react";
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import { g as
|
7
|
-
import { jsx as t, jsxs as
|
8
|
-
import { M as I } from "../../../../../../chunks/message.js";
|
4
|
+
import { useIntl as b, FormattedMessage as j } from "react-intl";
|
5
|
+
import d from "../../../../messages.js";
|
6
|
+
import { g as w } from "../../../../../../chunks/utils2.js";
|
7
|
+
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
9
8
|
const U = /* @__PURE__ */ $(({
|
10
|
-
className:
|
9
|
+
className: i,
|
11
10
|
isAiSuggestionApplied: u,
|
12
11
|
description: p,
|
13
12
|
disableForm: f,
|
@@ -16,41 +15,41 @@ const U = /* @__PURE__ */ $(({
|
|
16
15
|
label: n,
|
17
16
|
onValueEdited: v,
|
18
17
|
options: g,
|
19
|
-
portalElement:
|
20
|
-
},
|
18
|
+
portalElement: E
|
19
|
+
}, F) => {
|
21
20
|
const {
|
22
|
-
setFieldValue:
|
23
|
-
values:
|
24
|
-
} = C(), V = b(), m = `${h ?? s}.value`,
|
21
|
+
setFieldValue: x,
|
22
|
+
values: M
|
23
|
+
} = C(), V = b(), m = `${h ?? s}.value`, o = g || L(M, `${s}.options`, []).map(({
|
25
24
|
key: a
|
26
|
-
}) => a),
|
25
|
+
}) => a), c = V.formatMessage(d.selectValuePlaceholder);
|
27
26
|
return /* @__PURE__ */ t("div", {
|
28
27
|
"data-testid": `${n}-field`,
|
29
28
|
children: /* @__PURE__ */ t(P, {
|
30
29
|
name: m,
|
31
30
|
children: ({
|
32
31
|
field: a
|
33
|
-
}) => /* @__PURE__ */ t(
|
34
|
-
ref:
|
35
|
-
className:
|
32
|
+
}) => /* @__PURE__ */ t(l, {
|
33
|
+
ref: F,
|
34
|
+
className: i,
|
36
35
|
disabled: f,
|
37
|
-
label:
|
36
|
+
label: w(n, p, u),
|
38
37
|
onValueChange: (e) => {
|
39
|
-
|
38
|
+
x(m, e === r ? "" : e), v();
|
40
39
|
},
|
41
|
-
placeholder:
|
40
|
+
placeholder: c,
|
42
41
|
...a,
|
43
|
-
value: a.value ===
|
44
|
-
children: /* @__PURE__ */
|
45
|
-
container:
|
42
|
+
value: a.value === r ? "" : a.value,
|
43
|
+
children: /* @__PURE__ */ I(l.Content, {
|
44
|
+
container: E,
|
46
45
|
onEscapeKeyDown: (e) => e.stopPropagation(),
|
47
|
-
children: [/* @__PURE__ */ t(
|
48
|
-
text:
|
49
|
-
value:
|
50
|
-
children: /* @__PURE__ */ t(
|
51
|
-
...
|
46
|
+
children: [/* @__PURE__ */ t(l.Option, {
|
47
|
+
text: c,
|
48
|
+
value: r,
|
49
|
+
children: /* @__PURE__ */ t(j, {
|
50
|
+
...d.selectValuePlaceholder
|
52
51
|
})
|
53
|
-
}),
|
52
|
+
}), o == null ? void 0 : o.map((e) => /* @__PURE__ */ t(l.Option, {
|
54
53
|
text: e,
|
55
54
|
value: e,
|
56
55
|
children: e
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
const
|
1
|
+
import { useIntl as o } from "react-intl";
|
2
|
+
import n from "../../../../messages.js";
|
3
|
+
const s = (t) => t != null && t.length ? /^[-+]?\d+(\.\d+)?$/.test(t) : !0, l = () => {
|
4
4
|
const t = o();
|
5
5
|
return {
|
6
6
|
validateFloats: (r) => {
|
7
|
-
if (!
|
8
|
-
return t.formatMessage(
|
7
|
+
if (!s(r))
|
8
|
+
return t.formatMessage(n.floatFieldInvalidValue);
|
9
9
|
}
|
10
10
|
};
|
11
11
|
};
|
12
12
|
export {
|
13
|
-
|
13
|
+
s as isFloatOrBlank,
|
14
14
|
l as useFloatValidation
|
15
15
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Combobox as w } from "@box/blueprint-web";
|
2
2
|
import { useFormikContext as x, getIn as M, Field as $ } from "formik";
|
3
3
|
import { forwardRef as I } from "react";
|
4
|
-
import {
|
4
|
+
import { useIntl as j } from "react-intl";
|
5
5
|
import k from "../../../../messages.js";
|
6
6
|
import { g as D } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { fieldDefaultProps as O } from "../constants.js";
|
@@ -21,13 +21,13 @@ const E = /* @__PURE__ */ I(({
|
|
21
21
|
const {
|
22
22
|
setFieldValue: h,
|
23
23
|
values: F
|
24
|
-
} = x(), v = j(),
|
24
|
+
} = x(), v = j(), r = `${p ?? o}.value`, C = f || M(F, `${o}.options`, []).map(({
|
25
25
|
key: e
|
26
|
-
}) => e), L = (e,
|
26
|
+
}) => e), L = (e, a) => a.toLowerCase().includes(e.toLowerCase());
|
27
27
|
return /* @__PURE__ */ t("div", {
|
28
28
|
"data-testid": `${l}-field`,
|
29
29
|
children: /* @__PURE__ */ t($, {
|
30
|
-
name:
|
30
|
+
name: r,
|
31
31
|
children: ({
|
32
32
|
field: e
|
33
33
|
}) => {
|
@@ -44,7 +44,7 @@ const E = /* @__PURE__ */ I(({
|
|
44
44
|
multiselect: !0,
|
45
45
|
name: e.name,
|
46
46
|
onValueChange: (V) => {
|
47
|
-
h(
|
47
|
+
h(r, V), d();
|
48
48
|
},
|
49
49
|
options: C,
|
50
50
|
placeholder: b,
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { TextInput as
|
1
|
+
import { TextInput as u } from "@box/blueprint-web";
|
2
2
|
import { Field as c } from "formik";
|
3
3
|
import { forwardRef as h } from "react";
|
4
|
-
import {
|
4
|
+
import { useIntl as x } from "react-intl";
|
5
5
|
import F from "../../../../messages.js";
|
6
6
|
import { g as M } from "../../../../../../chunks/utils2.js";
|
7
7
|
import { fieldDefaultProps as b } from "../constants.js";
|
@@ -15,26 +15,26 @@ const v = /* @__PURE__ */ h(({
|
|
15
15
|
label: r,
|
16
16
|
onValueEdited: m,
|
17
17
|
updateModePrefix: d
|
18
|
-
},
|
19
|
-
const
|
18
|
+
}, f) => {
|
19
|
+
const s = x(), n = `${d ?? l}.value`;
|
20
20
|
return /* @__PURE__ */ e("div", {
|
21
21
|
"data-testid": `${r}-field`,
|
22
22
|
children: /* @__PURE__ */ e(c, {
|
23
23
|
name: n,
|
24
24
|
children: ({
|
25
25
|
field: p,
|
26
|
-
meta:
|
27
|
-
}) => /* @__PURE__ */ e(
|
26
|
+
meta: g
|
27
|
+
}) => /* @__PURE__ */ e(u, {
|
28
28
|
...b,
|
29
29
|
...p,
|
30
|
-
ref:
|
30
|
+
ref: f,
|
31
31
|
className: t,
|
32
32
|
disabled: i,
|
33
|
-
error:
|
33
|
+
error: g.error,
|
34
34
|
label: M(r, a, o),
|
35
35
|
maxLength: 524288,
|
36
36
|
onChangeCapture: m,
|
37
|
-
placeholder:
|
37
|
+
placeholder: s.formatMessage(F.setValuePlaceholder)
|
38
38
|
})
|
39
39
|
})
|
40
40
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useFormikContext as w, getIn as I, Field as K } from "formik";
|
2
2
|
import { forwardRef as M } from "react";
|
3
|
-
import {
|
3
|
+
import { useIntl as R } from "react-intl";
|
4
4
|
import $ from "../../../../messages.js";
|
5
5
|
import { ComboboxWithApiPagination as j } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
|
6
6
|
import { g as A } from "../../../../../../chunks/utils2.js";
|
@@ -12,11 +12,11 @@ const E = /* @__PURE__ */ M(({
|
|
12
12
|
fieldNamePrefix: r,
|
13
13
|
label: n,
|
14
14
|
portalElement: p,
|
15
|
-
taxonomyOptionsFetcher:
|
16
|
-
updateModePrefix:
|
15
|
+
taxonomyOptionsFetcher: c,
|
16
|
+
updateModePrefix: u,
|
17
17
|
className: f
|
18
18
|
}, g) => {
|
19
|
-
const h = R(), a = `${
|
19
|
+
const h = R(), a = `${u ?? r}.value`, {
|
20
20
|
setFieldValue: F,
|
21
21
|
values: i
|
22
22
|
} = w(), {
|
@@ -30,7 +30,7 @@ const E = /* @__PURE__ */ M(({
|
|
30
30
|
multiSelect: m,
|
31
31
|
selectableLevels: t
|
32
32
|
}
|
33
|
-
} = y, k = (o) =>
|
33
|
+
} = y, k = (o) => c(x, v, b, t == null ? void 0 : t[0], o), C = (o) => m || !(o != null && o.length) ? h.formatMessage($.taxonomyPlaceholder) : void 0;
|
34
34
|
return /* @__PURE__ */ e("div", {
|
35
35
|
"data-testid": `${n}-field`,
|
36
36
|
onKeyDown: (o) => o.stopPropagation(),
|
@@ -3,7 +3,7 @@ import { Settings as A, XMark as E } from "@box/blueprint-web-assets/icons/Fill"
|
|
3
3
|
import R from "clsx";
|
4
4
|
import { useFormikContext as U, getIn as _, Field as w } from "formik";
|
5
5
|
import C, { useState as S } from "react";
|
6
|
-
import {
|
6
|
+
import { useIntl as B } from "react-intl";
|
7
7
|
import { U as r } from "../../../../../../chunks/types.js";
|
8
8
|
import { messages as l } from "./messages.js";
|
9
9
|
import { MULTI_VALUE_DEFAULT_OPTION as N } from "./mulitple-values-utils.js";
|