@box/metadata-editor 0.63.0 → 0.64.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/chunks/metadata-editor-field-wrapper.js +55 -50
- package/esm/index.js +26 -26
- package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +132 -131
- package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +37 -43
- package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +38 -44
- package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +30 -36
- package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +39 -47
- package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -34
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +54 -0
- package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +49 -48
- package/esm/lib/components/metadata-editor-fields/editor-field-types.js +19 -15
- package/esm/lib/components/metadata-editor-fields/utils.js +13 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +48 -46
- package/esm/lib/defaults.js +2 -1
- package/esm/lib/messages.js +4 -0
- package/i18n/bn-IN.js +1 -0
- package/i18n/da-DK.js +1 -0
- package/i18n/de-DE.js +1 -0
- package/i18n/en-AU.js +1 -0
- package/i18n/en-CA.js +1 -0
- package/i18n/en-GB.js +1 -0
- package/i18n/en-US.js +1 -0
- package/i18n/en-US.properties +2 -0
- package/i18n/en-x-pseudo.js +1 -0
- package/i18n/es-419.js +1 -0
- package/i18n/es-ES.js +1 -0
- package/i18n/fi-FI.js +1 -0
- package/i18n/fr-CA.js +1 -0
- package/i18n/fr-FR.js +1 -0
- package/i18n/hi-IN.js +1 -0
- package/i18n/it-IT.js +1 -0
- package/i18n/ja-JP.js +1 -0
- package/i18n/json/src/lib/messages.json +1 -1
- package/i18n/ko-KR.js +1 -0
- package/i18n/nb-NO.js +1 -0
- package/i18n/nl-NL.js +1 -0
- package/i18n/pl-PL.js +1 -0
- package/i18n/pt-BR.js +1 -0
- package/i18n/ru-RU.js +1 -0
- package/i18n/sv-SE.js +1 -0
- package/i18n/tr-TR.js +1 -0
- package/i18n/zh-CN.js +1 -0
- package/i18n/zh-TW.js +1 -0
- package/package.json +3 -3
- package/types/index.d.ts +1 -1
- package/types/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.d.ts +16 -2
- package/types/lib/components/combobox-with-api-pagination/index.d.ts +1 -1
- package/types/lib/components/combobox-with-api-pagination/types.d.ts +5 -8
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.d.ts +3 -0
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.d.ts +6 -21
- package/types/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.d.ts +2 -1
- package/types/lib/components/metadata-editor-fields/editor-field-types.d.ts +1 -0
- package/types/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.d.ts +1 -0
- package/types/lib/components/metadata-editor-fields/types.d.ts +5 -0
- package/types/lib/components/metadata-editor-fields/utils.d.ts +3 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +4 -2
- package/types/lib/components/metadata-instance-editor/types.d.ts +2 -4
- package/types/lib/messages.d.ts +5 -0
- package/types/lib/test-utils/sample-data.d.ts +4 -1
- package/types/lib/types.d.ts +11 -3
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/index.js +0 -4
- package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/single-level-taxonomy-field.js +0 -8
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/index.d.ts +0 -2
- package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/single-level-taxonomy-field.d.ts +0 -5
@@ -1,58 +1,52 @@
|
|
1
|
-
import { Select as l, SELECT_EMPTY_VALUE as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { useIntl as
|
4
|
-
import { forwardRef as
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { jsx as t, jsxs as
|
8
|
-
const
|
9
|
-
className:
|
10
|
-
description:
|
11
|
-
disableForm:
|
12
|
-
fieldNamePrefix:
|
13
|
-
label:
|
14
|
-
options:
|
15
|
-
portalElement:
|
16
|
-
|
1
|
+
import { Select as l, SELECT_EMPTY_VALUE as o } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as M, getIn as V, Field as C } from "formik";
|
3
|
+
import { useIntl as L, FormattedMessage as $ } from "react-intl";
|
4
|
+
import { forwardRef as b } from "react";
|
5
|
+
import c from "../../../../messages.js";
|
6
|
+
import { getFieldLabel as j } from "../../utils.js";
|
7
|
+
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
8
|
+
const U = /* @__PURE__ */ b(({
|
9
|
+
className: u,
|
10
|
+
description: i,
|
11
|
+
disableForm: f,
|
12
|
+
fieldNamePrefix: s,
|
13
|
+
label: n,
|
14
|
+
options: h,
|
15
|
+
portalElement: p,
|
16
|
+
updateModePrefix: v
|
17
|
+
}, g) => {
|
17
18
|
const {
|
18
|
-
setFieldValue:
|
19
|
-
values:
|
20
|
-
} =
|
19
|
+
setFieldValue: F,
|
20
|
+
values: x
|
21
|
+
} = M(), E = L(), m = `${v ?? s}.value`, r = h || V(x, `${s}.options`, []).map(({
|
21
22
|
key: a
|
22
|
-
}) => a), d = E.formatMessage(
|
23
|
+
}) => a), d = E.formatMessage(c.selectValuePlaceholder);
|
23
24
|
return /* @__PURE__ */ t("div", {
|
24
|
-
"data-testid": `${
|
25
|
-
children: /* @__PURE__ */ t(
|
26
|
-
name:
|
25
|
+
"data-testid": `${n}-field`,
|
26
|
+
children: /* @__PURE__ */ t(C, {
|
27
|
+
name: m,
|
27
28
|
children: ({
|
28
29
|
field: a
|
29
30
|
}) => /* @__PURE__ */ t(l, {
|
30
|
-
ref:
|
31
|
-
className:
|
32
|
-
disabled:
|
33
|
-
label: n
|
34
|
-
...e
|
35
|
-
}) => $({
|
36
|
-
as: "label",
|
37
|
-
tooltipText: n,
|
38
|
-
children: r,
|
39
|
-
...e
|
40
|
-
}) : r,
|
31
|
+
ref: g,
|
32
|
+
className: u,
|
33
|
+
disabled: f,
|
34
|
+
label: j(n, i),
|
41
35
|
onValueChange: (e) => {
|
42
|
-
|
36
|
+
F(m, e === o ? "" : e);
|
43
37
|
},
|
44
38
|
placeholder: d,
|
45
39
|
...a,
|
46
|
-
value: a.value ===
|
47
|
-
children: /* @__PURE__ */
|
48
|
-
container:
|
40
|
+
value: a.value === o ? "" : a.value,
|
41
|
+
children: /* @__PURE__ */ I(l.Content, {
|
42
|
+
container: p,
|
49
43
|
children: [/* @__PURE__ */ t(l.Option, {
|
50
44
|
text: d,
|
51
|
-
value:
|
52
|
-
children: /* @__PURE__ */ t(
|
53
|
-
...
|
45
|
+
value: o,
|
46
|
+
children: /* @__PURE__ */ t($, {
|
47
|
+
...c.selectValuePlaceholder
|
54
48
|
})
|
55
|
-
}),
|
49
|
+
}), r == null ? void 0 : r.map((e) => /* @__PURE__ */ t(l.Option, {
|
56
50
|
text: e,
|
57
51
|
value: e,
|
58
52
|
children: e
|
@@ -63,6 +57,6 @@ const R = /* @__PURE__ */ I(({
|
|
63
57
|
});
|
64
58
|
});
|
65
59
|
export {
|
66
|
-
|
67
|
-
|
60
|
+
U as MetadataEnumField,
|
61
|
+
U as default
|
68
62
|
};
|
@@ -1,53 +1,47 @@
|
|
1
|
-
import { TextInput as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { forwardRef as
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import { jsx as
|
8
|
-
const N = /* @__PURE__ */
|
9
|
-
className:
|
10
|
-
description:
|
11
|
-
label:
|
12
|
-
fieldNamePrefix:
|
13
|
-
disableForm:
|
1
|
+
import { TextInput as b } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as C, getIn as R, Field as T } from "formik";
|
3
|
+
import { forwardRef as V, useRef as $ } from "react";
|
4
|
+
import { fieldDefaultProps as B } from "../constants.js";
|
5
|
+
import { useFloatValidation as I } from "./use-float-validation.js";
|
6
|
+
import { getFieldLabel as O } from "../../utils.js";
|
7
|
+
import { jsx as r } from "react/jsx-runtime";
|
8
|
+
const N = /* @__PURE__ */ V(({
|
9
|
+
className: l,
|
10
|
+
description: n,
|
11
|
+
label: o,
|
12
|
+
fieldNamePrefix: i,
|
13
|
+
disableForm: d,
|
14
|
+
updateModePrefix: s
|
14
15
|
}, u) => {
|
15
16
|
const {
|
16
17
|
values: f,
|
17
18
|
setFieldValue: m,
|
18
19
|
setFieldTouched: c
|
19
|
-
} =
|
20
|
-
validateFloats:
|
21
|
-
} =
|
22
|
-
|
20
|
+
} = C(), t = `${s ?? i}.value`, p = R(f, t), a = $(p), {
|
21
|
+
validateFloats: F
|
22
|
+
} = I(), h = (e) => {
|
23
|
+
a.current = e, m(t, e);
|
23
24
|
}, v = (e) => {
|
24
25
|
c(e, !0);
|
25
26
|
};
|
26
|
-
return /* @__PURE__ */
|
27
|
-
"data-testid": `${
|
28
|
-
children: /* @__PURE__ */
|
27
|
+
return /* @__PURE__ */ r("div", {
|
28
|
+
"data-testid": `${o}-field`,
|
29
|
+
children: /* @__PURE__ */ r(T, {
|
29
30
|
name: `${t}`,
|
30
|
-
validate: () =>
|
31
|
+
validate: () => F(a.current),
|
31
32
|
children: ({
|
32
33
|
field: e,
|
33
|
-
meta:
|
34
|
-
}) => /* @__PURE__ */
|
35
|
-
...
|
34
|
+
meta: g
|
35
|
+
}) => /* @__PURE__ */ r(b, {
|
36
|
+
...B,
|
36
37
|
...e,
|
37
38
|
ref: u,
|
38
|
-
className:
|
39
|
-
disabled:
|
40
|
-
error:
|
41
|
-
label:
|
42
|
-
...o
|
43
|
-
}) => $({
|
44
|
-
as: "label",
|
45
|
-
tooltipText: l,
|
46
|
-
children: r,
|
47
|
-
...o
|
48
|
-
}) : r,
|
39
|
+
className: l,
|
40
|
+
disabled: d,
|
41
|
+
error: g.error,
|
42
|
+
label: O(o, n),
|
49
43
|
onBlur: () => v(t),
|
50
|
-
onChange: (
|
44
|
+
onChange: (x) => h(x.currentTarget.value),
|
51
45
|
placeholder: "0",
|
52
46
|
type: "number"
|
53
47
|
})
|
@@ -1,64 +1,56 @@
|
|
1
|
-
import {
|
2
|
-
import { useFormikContext as
|
3
|
-
import { useIntl as
|
1
|
+
import { Combobox as C } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as b, getIn as w, Field as x } from "formik";
|
3
|
+
import { useIntl as L } from "react-intl";
|
4
4
|
import { forwardRef as M } from "react";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import {
|
5
|
+
import $ from "../../../../messages.js";
|
6
|
+
import { fieldDefaultProps as I } from "../constants.js";
|
7
|
+
import { getFieldLabel as V } from "../../utils.js";
|
8
8
|
import { jsx as o } from "react/jsx-runtime";
|
9
|
-
const
|
10
|
-
className:
|
11
|
-
description:
|
12
|
-
disableForm:
|
13
|
-
fieldNamePrefix:
|
14
|
-
label:
|
15
|
-
portalElement:
|
16
|
-
options: u
|
9
|
+
const y = /* @__PURE__ */ M(({
|
10
|
+
className: i,
|
11
|
+
description: s,
|
12
|
+
disableForm: n,
|
13
|
+
fieldNamePrefix: r,
|
14
|
+
label: l,
|
15
|
+
portalElement: m,
|
16
|
+
options: u,
|
17
|
+
updateModePrefix: d
|
17
18
|
}, p) => {
|
18
19
|
const {
|
19
|
-
setFieldValue:
|
20
|
-
values:
|
21
|
-
} =
|
20
|
+
setFieldValue: f,
|
21
|
+
values: c
|
22
|
+
} = b(), F = L(), a = `${d ?? r}.value`, g = u || w(c, `${r}.options`, []).map(({
|
22
23
|
key: e
|
23
|
-
}) => e),
|
24
|
+
}) => e), h = (e, t) => t.toLowerCase().includes(e.toLowerCase());
|
24
25
|
return /* @__PURE__ */ o("div", {
|
25
|
-
"data-testid": `${
|
26
|
-
children: /* @__PURE__ */ o(
|
27
|
-
name:
|
26
|
+
"data-testid": `${l}-field`,
|
27
|
+
children: /* @__PURE__ */ o(x, {
|
28
|
+
name: a,
|
28
29
|
children: ({
|
29
30
|
field: e
|
30
31
|
}) => {
|
31
32
|
var t;
|
32
|
-
return /* @__PURE__ */ o(
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}) : r,
|
48
|
-
multiselect: !0,
|
49
|
-
name: e.name,
|
50
|
-
onValueChange: (l) => c(n, l),
|
51
|
-
options: v,
|
52
|
-
placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? h.formatMessage(T.multiselectPlaceholder) : "",
|
53
|
-
portalElement: d,
|
54
|
-
value: e.value
|
55
|
-
})
|
33
|
+
return /* @__PURE__ */ o(C, {
|
34
|
+
...I,
|
35
|
+
ref: p,
|
36
|
+
as: "input",
|
37
|
+
className: i,
|
38
|
+
disabled: n,
|
39
|
+
filterFn: h,
|
40
|
+
label: V(l, s),
|
41
|
+
multiselect: !0,
|
42
|
+
name: e.name,
|
43
|
+
onValueChange: (v) => f(a, v),
|
44
|
+
options: g,
|
45
|
+
placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? F.formatMessage($.multiselectPlaceholder) : "",
|
46
|
+
portalElement: m,
|
47
|
+
value: e.value
|
56
48
|
});
|
57
49
|
}
|
58
50
|
})
|
59
51
|
});
|
60
52
|
});
|
61
53
|
export {
|
62
|
-
|
63
|
-
|
54
|
+
y as MetadataMultiSelectField,
|
55
|
+
y as default
|
64
56
|
};
|
@@ -1,48 +1,42 @@
|
|
1
|
-
import { TextInput as
|
1
|
+
import { TextInput as n } from "@box/blueprint-web";
|
2
2
|
import { Field as c } from "formik";
|
3
3
|
import { useIntl as u } from "react-intl";
|
4
|
-
import { forwardRef as
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import { jsx as
|
9
|
-
const
|
4
|
+
import { forwardRef as g } from "react";
|
5
|
+
import h from "../../../../messages.js";
|
6
|
+
import { fieldDefaultProps as F } from "../constants.js";
|
7
|
+
import { getFieldLabel as x } from "../../utils.js";
|
8
|
+
import { jsx as e } from "react/jsx-runtime";
|
9
|
+
const M = /* @__PURE__ */ g(({
|
10
10
|
description: t,
|
11
|
-
label:
|
11
|
+
label: r,
|
12
12
|
fieldNamePrefix: o,
|
13
13
|
disableForm: a,
|
14
|
-
className: i
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
className: i,
|
15
|
+
updateModePrefix: l
|
16
|
+
}, d) => {
|
17
|
+
const m = u(), f = `${l ?? o}.value`;
|
18
|
+
return /* @__PURE__ */ e("div", {
|
19
|
+
"data-testid": `${r}-field`,
|
20
|
+
children: /* @__PURE__ */ e(c, {
|
21
|
+
name: f,
|
21
22
|
children: ({
|
22
|
-
field:
|
23
|
-
meta:
|
24
|
-
}) => /* @__PURE__ */
|
25
|
-
...
|
26
|
-
...
|
27
|
-
ref:
|
23
|
+
field: s,
|
24
|
+
meta: p
|
25
|
+
}) => /* @__PURE__ */ e(n, {
|
26
|
+
...F,
|
27
|
+
...s,
|
28
|
+
ref: d,
|
28
29
|
className: i,
|
29
30
|
disabled: a,
|
30
|
-
error:
|
31
|
-
label: t
|
32
|
-
|
33
|
-
}) => g({
|
34
|
-
as: "label",
|
35
|
-
tooltipText: t,
|
36
|
-
children: e,
|
37
|
-
...n
|
38
|
-
}) : e,
|
39
|
-
placeholder: m.formatMessage(x.setValuePlaceholder)
|
31
|
+
error: p.error,
|
32
|
+
label: x(r, t),
|
33
|
+
placeholder: m.formatMessage(h.setValuePlaceholder)
|
40
34
|
})
|
41
35
|
})
|
42
36
|
});
|
43
37
|
});
|
44
|
-
|
38
|
+
M.displayName = "MetadataStringField";
|
45
39
|
export {
|
46
|
-
|
47
|
-
|
40
|
+
M as MetadataStringField,
|
41
|
+
M as default
|
48
42
|
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { forwardRef as k } from "react";
|
2
|
+
import { useFormikContext as C, getIn as I, Field as M } from "formik";
|
3
|
+
import { useIntl as R } from "react-intl";
|
4
|
+
import { ComboboxWithApiPagination as V } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
|
5
|
+
import $ from "../../../../messages.js";
|
6
|
+
import { getFieldLabel as j } from "../../utils.js";
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
8
|
+
const q = /* @__PURE__ */ k(({
|
9
|
+
description: m,
|
10
|
+
disableForm: n,
|
11
|
+
fieldNamePrefix: r,
|
12
|
+
label: a,
|
13
|
+
portalElement: s,
|
14
|
+
taxonomyOptionsFetcher: d,
|
15
|
+
updateModePrefix: c
|
16
|
+
}, u) => {
|
17
|
+
const f = R(), i = `${c ?? r}.value`, {
|
18
|
+
setFieldValue: p,
|
19
|
+
values: l
|
20
|
+
} = C(), {
|
21
|
+
metadata: {
|
22
|
+
templateKey: h,
|
23
|
+
scope: F
|
24
|
+
}
|
25
|
+
} = l, g = I(l, r), {
|
26
|
+
key: x,
|
27
|
+
optionsRules: {
|
28
|
+
multiSelect: v,
|
29
|
+
selectableLevels: e
|
30
|
+
}
|
31
|
+
} = g, y = (t) => d(F, h, x, e == null ? void 0 : e[0], t);
|
32
|
+
return /* @__PURE__ */ o("div", {
|
33
|
+
"data-testid": `${a}-field`,
|
34
|
+
children: /* @__PURE__ */ o(M, {
|
35
|
+
name: i,
|
36
|
+
children: ({
|
37
|
+
field: t
|
38
|
+
}) => /* @__PURE__ */ o(V, {
|
39
|
+
ref: u,
|
40
|
+
defaultFetcher: y,
|
41
|
+
disabled: n,
|
42
|
+
label: j(a, m),
|
43
|
+
multiselect: v,
|
44
|
+
onValueChange: (b) => p(i, b),
|
45
|
+
placeholder: f.formatMessage($.taxonomyPlaceholder),
|
46
|
+
portalElement: s,
|
47
|
+
value: t.value
|
48
|
+
})
|
49
|
+
})
|
50
|
+
});
|
51
|
+
});
|
52
|
+
export {
|
53
|
+
q as MetadataTaxonomyField
|
54
|
+
};
|
@@ -1,30 +1,31 @@
|
|
1
1
|
import "../../../../../../styles/update-mode-field-wrapper.css";
|
2
|
-
import { IconButton as
|
3
|
-
import { Settings as
|
4
|
-
import
|
5
|
-
import { useFormikContext as
|
6
|
-
import _, { useState as
|
7
|
-
import { useIntl as
|
8
|
-
import { U as
|
9
|
-
import { messages as
|
2
|
+
import { IconButton as I, Radio as d } from "@box/blueprint-web";
|
3
|
+
import { Settings as R, XMark as w } from "@box/blueprint-web-assets/icons/Fill";
|
4
|
+
import A from "clsx";
|
5
|
+
import { useFormikContext as E, getIn as C, Field as S } from "formik";
|
6
|
+
import _, { useState as B } from "react";
|
7
|
+
import { useIntl as U } from "react-intl";
|
8
|
+
import { U as i } from "../../../../../../chunks/types.js";
|
9
|
+
import { messages as l } from "./messages.js";
|
10
10
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
11
|
-
const
|
12
|
-
wrapperContianer:
|
13
|
-
fieldContainer:
|
14
|
-
field:
|
15
|
-
collapseButton:
|
16
|
-
radioContainer:
|
17
|
-
additionalFieldContainer:
|
18
|
-
hidden:
|
19
|
-
},
|
11
|
+
const $ = "_wrapperContianer_1n09p_1", N = "_fieldContainer_1n09p_6", k = "_field_1n09p_6", x = "_collapseButton_1n09p_13", G = "_radioContainer_1n09p_19", V = "_additionalFieldContainer_1n09p_22", j = "_hidden_1n09p_26", t = {
|
12
|
+
wrapperContianer: $,
|
13
|
+
fieldContainer: N,
|
14
|
+
field: k,
|
15
|
+
collapseButton: x,
|
16
|
+
radioContainer: G,
|
17
|
+
additionalFieldContainer: V,
|
18
|
+
hidden: j
|
19
|
+
}, y = (e) => e === i.ReplaceEntered, L = (e, a) => e === "string" || e === "multiSelect" || a, O = ({
|
20
20
|
children: e,
|
21
|
-
fieldNamePrefix:
|
22
|
-
fieldType: f
|
21
|
+
fieldNamePrefix: a,
|
22
|
+
fieldType: f,
|
23
|
+
isTaxonomyMultiSelect: g
|
23
24
|
}) => {
|
24
25
|
const {
|
25
|
-
setFieldValue:
|
26
|
+
setFieldValue: M,
|
26
27
|
values: m
|
27
|
-
} =
|
28
|
+
} = E(), [p, h] = B(!0), n = U(), u = `${a}.updateMode.mode`, v = C(m, u), r = e && _.Children.only(e), b = C(m, `${a}.options`, []).map(({
|
28
29
|
key: c
|
29
30
|
}) => c);
|
30
31
|
return /* @__PURE__ */ s("div", {
|
@@ -34,58 +35,58 @@ const N = "_wrapperContianer_1n09p_1", U = "_fieldContainer_1n09p_6", $ = "_fiel
|
|
34
35
|
children: [/* @__PURE__ */ o("span", {
|
35
36
|
className: t.field,
|
36
37
|
children: e
|
37
|
-
}), /* @__PURE__ */ o(
|
38
|
-
"aria-label":
|
38
|
+
}), /* @__PURE__ */ o(I, {
|
39
|
+
"aria-label": n.formatMessage(l.toggleUpdateModeSelectiorAriaLabel),
|
39
40
|
className: t.collapseButton,
|
40
41
|
"data-testid": `${r.props.label}-update-mode-toggle`,
|
41
|
-
icon: p ?
|
42
|
+
icon: p ? R : w,
|
42
43
|
onClick: () => {
|
43
|
-
|
44
|
+
h(!p);
|
44
45
|
},
|
45
46
|
size: "small",
|
46
47
|
"data-target-id": "IconButton-toggleUpdateModeSelectiorAriaLabel"
|
47
48
|
})]
|
48
49
|
}), /* @__PURE__ */ s("div", {
|
49
|
-
className:
|
50
|
+
className: A(t.radioContainer, {
|
50
51
|
[t.hidden]: p
|
51
52
|
}),
|
52
|
-
children: [/* @__PURE__ */ o(
|
53
|
-
name: `${
|
53
|
+
children: [/* @__PURE__ */ o(S, {
|
54
|
+
name: `${a}.updateMode.mode`,
|
54
55
|
children: ({
|
55
56
|
field: c
|
56
|
-
}) => /* @__PURE__ */ s(
|
57
|
+
}) => /* @__PURE__ */ s(d.Group, {
|
57
58
|
"data-testid": `${r.props.label}-radio-group`,
|
58
59
|
loop: !0,
|
59
|
-
onValueChange: (
|
60
|
+
onValueChange: (F) => M(u, F),
|
60
61
|
orientation: "vertical",
|
61
62
|
value: c.value,
|
62
|
-
children: [
|
63
|
-
label:
|
64
|
-
value:
|
65
|
-
}), /* @__PURE__ */ o(
|
66
|
-
label:
|
67
|
-
value:
|
68
|
-
}), /* @__PURE__ */ o(
|
69
|
-
label:
|
70
|
-
value:
|
71
|
-
}), /* @__PURE__ */ o(
|
72
|
-
label:
|
73
|
-
value:
|
63
|
+
children: [L(f, g) && /* @__PURE__ */ o(d.Item, {
|
64
|
+
label: n.formatMessage(l.append),
|
65
|
+
value: i.Append
|
66
|
+
}), /* @__PURE__ */ o(d.Item, {
|
67
|
+
label: n.formatMessage(l.clearAndReplace),
|
68
|
+
value: i.ClearAndReplace
|
69
|
+
}), /* @__PURE__ */ o(d.Item, {
|
70
|
+
label: n.formatMessage(l.removeEntered),
|
71
|
+
value: i.RemoveEntered
|
72
|
+
}), /* @__PURE__ */ o(d.Item, {
|
73
|
+
label: n.formatMessage(l.replaceEntered),
|
74
|
+
value: i.ReplaceEntered
|
74
75
|
})]
|
75
76
|
})
|
76
|
-
}),
|
77
|
+
}), y(v) && r && /* @__PURE__ */ o("div", {
|
77
78
|
className: t.additionalFieldContainer,
|
78
79
|
children: /* @__PURE__ */ _.cloneElement(r, {
|
79
80
|
// This field edits ${fieldNamePrefix}.updateMode.value, the '.value' is added by the field component
|
80
|
-
|
81
|
-
options:
|
82
|
-
label:
|
81
|
+
updateModePrefix: `${a}.updateMode`,
|
82
|
+
options: b,
|
83
|
+
label: n.formatMessage(l.with)
|
83
84
|
})
|
84
85
|
})]
|
85
86
|
})]
|
86
87
|
});
|
87
88
|
};
|
88
|
-
|
89
|
+
O.displayName = "UpdateModeFieldWrapper";
|
89
90
|
export {
|
90
|
-
|
91
|
+
O as UpdateModeFieldWrapper
|
91
92
|
};
|
@@ -1,32 +1,36 @@
|
|
1
|
-
import { forwardRef as
|
2
|
-
import { MetadataDateField as
|
3
|
-
import { MetadataEnumField as
|
4
|
-
import { MetadataFloatField as
|
5
|
-
import { MetadataMultiSelectField as
|
6
|
-
import { MetadataStringField as
|
7
|
-
import {
|
8
|
-
|
9
|
-
|
1
|
+
import { forwardRef as o } from "react";
|
2
|
+
import { MetadataDateField as a } from "./components/metadata-date-field/metadata-date-field.js";
|
3
|
+
import { MetadataEnumField as m } from "./components/metadata-enum-field/metadata-enum-field.js";
|
4
|
+
import { MetadataFloatField as i } from "./components/metadata-float-field/metadata-float-field.js";
|
5
|
+
import { MetadataMultiSelectField as d } from "./components/metadata-multi-select-field/metadata-multi-select-field.js";
|
6
|
+
import { MetadataStringField as f } from "./components/metadata-string-field/metadata-string-field.js";
|
7
|
+
import { MetadataTaxonomyField as l } from "./components/metadata-taxonomy-field/metadata-taxonomy-field.js";
|
8
|
+
import { jsx as r } from "react/jsx-runtime";
|
9
|
+
const y = {
|
10
|
+
date: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(a, {
|
10
11
|
...t,
|
11
12
|
ref: e
|
12
13
|
})),
|
13
|
-
enum: /* @__PURE__ */
|
14
|
+
enum: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(m, {
|
14
15
|
...t,
|
15
16
|
ref: e
|
16
17
|
})),
|
17
|
-
float: /* @__PURE__ */
|
18
|
+
float: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(i, {
|
18
19
|
...t,
|
19
20
|
ref: e
|
20
21
|
})),
|
21
|
-
multiSelect: /* @__PURE__ */
|
22
|
+
multiSelect: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(d, {
|
22
23
|
...t,
|
23
24
|
ref: e
|
24
25
|
})),
|
25
|
-
string: /* @__PURE__ */
|
26
|
+
string: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(f, {
|
26
27
|
...t,
|
27
28
|
ref: e
|
28
|
-
}))
|
29
|
+
})),
|
30
|
+
taxonomy: (t) => /* @__PURE__ */ r(l, {
|
31
|
+
...t
|
32
|
+
})
|
29
33
|
};
|
30
34
|
export {
|
31
|
-
|
35
|
+
y as editorFieldTypes
|
32
36
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import o from "../interactive-text/interactive-text.js";
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
3
|
+
const n = (t, e) => e ? ({
|
4
|
+
...r
|
5
|
+
}) => /* @__PURE__ */ i(o, {
|
6
|
+
...r,
|
7
|
+
as: "label",
|
8
|
+
tooltipText: e,
|
9
|
+
children: t
|
10
|
+
}) : t;
|
11
|
+
export {
|
12
|
+
n as getFieldLabel
|
13
|
+
};
|