@box/metadata-editor 0.51.1 → 0.51.2
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 +18 -16
- package/esm/lib/components/interactive-text/interactive-text.js +16 -10
- package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +57 -50
- package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +39 -30
- package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +43 -34
- package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +39 -30
- package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +37 -28
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +19 -21
- package/package.json +2 -2
- package/styles/interactive-text.css +1 -0
- package/styles/metadata-instance-entry.css +1 -1
- package/types/lib/components/interactive-text/interactive-text.d.ts +2 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
- package/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
- package/types/lib/test-utils/sample-data.d.ts +1 -1
@@ -13,48 +13,50 @@ const W = "_noAttributesText_vykxc_1", M = "_fieldWrapper_vykxc_5", N = "_hasSug
|
|
13
13
|
hasSuggestion: N,
|
14
14
|
error: T
|
15
15
|
}, E = ({
|
16
|
-
disableForm:
|
17
|
-
portalElement:
|
16
|
+
disableForm: n,
|
17
|
+
portalElement: a,
|
18
18
|
field: e,
|
19
19
|
index: p
|
20
20
|
}) => {
|
21
21
|
const {
|
22
22
|
setFieldValue: d
|
23
|
-
} = x(), [
|
24
|
-
if (!
|
23
|
+
} = x(), [l, i] = h(!0), r = k[e.type], g = r && !e.hidden, m = !_(e.updateMode), s = `metadata.fields[${p}]`;
|
24
|
+
if (!g)
|
25
25
|
return null;
|
26
26
|
if (m)
|
27
27
|
return /* @__PURE__ */ o(v, {
|
28
28
|
fieldNamePrefix: s,
|
29
29
|
fieldType: e.type,
|
30
|
-
children: /* @__PURE__ */ o(
|
31
|
-
|
30
|
+
children: /* @__PURE__ */ o(r, {
|
31
|
+
description: e.description,
|
32
|
+
disableForm: n,
|
32
33
|
fieldNamePrefix: s,
|
33
34
|
label: e.displayName,
|
34
|
-
portalElement:
|
35
|
+
portalElement: a
|
35
36
|
})
|
36
37
|
}, e.key);
|
37
38
|
const {
|
38
39
|
aiSuggestion: t,
|
39
40
|
value: f
|
40
|
-
} = e,
|
41
|
+
} = e, c = t && l;
|
41
42
|
return /* @__PURE__ */ F("div", {
|
42
43
|
className: u.fieldWrapper,
|
43
|
-
children: [/* @__PURE__ */ o(
|
44
|
-
className: S(
|
45
|
-
|
44
|
+
children: [/* @__PURE__ */ o(r, {
|
45
|
+
className: S(c && u.hasSuggestion),
|
46
|
+
description: e.description,
|
47
|
+
disableForm: n,
|
46
48
|
fieldNamePrefix: `metadata.fields[${p}]`,
|
47
49
|
label: e.displayName,
|
48
|
-
portalElement:
|
49
|
-
}),
|
50
|
+
portalElement: a
|
51
|
+
}), c && /* @__PURE__ */ o(A, {
|
50
52
|
aiSuggestion: t,
|
51
53
|
onAiSuggestionAppend: () => {
|
52
54
|
const y = e.type === "multiSelect" ? [f, t].flat() : t;
|
53
|
-
d(`${s}.value`, y),
|
55
|
+
d(`${s}.value`, y), i(!1);
|
54
56
|
},
|
55
|
-
onAiSuggestionIgnore: () =>
|
57
|
+
onAiSuggestionIgnore: () => i(!1),
|
56
58
|
onAiSuggestionReplace: () => {
|
57
|
-
d(`${s}.value`, t),
|
59
|
+
d(`${s}.value`, t), i(!1);
|
58
60
|
}
|
59
61
|
})]
|
60
62
|
}, e.key);
|
@@ -1,26 +1,32 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import "../../../../styles/interactive-text.css";
|
2
|
+
import { Focusable as n } from "@ariakit/react";
|
3
|
+
import { Tooltip as a, Text as s } from "@box/blueprint-web";
|
4
|
+
import m from "clsx";
|
3
5
|
import { jsx as t } from "react/jsx-runtime";
|
4
|
-
const l =
|
6
|
+
const x = "_interactiveText_2jv0p_1", l = {
|
7
|
+
interactiveText: x
|
8
|
+
}, d = ({
|
5
9
|
tooltipText: r,
|
6
|
-
|
10
|
+
className: i,
|
11
|
+
children: c,
|
7
12
|
...e
|
8
13
|
}) => {
|
9
14
|
const {
|
10
|
-
as:
|
15
|
+
as: o = "span"
|
11
16
|
} = e;
|
12
17
|
return /* @__PURE__ */ t(a, {
|
13
18
|
__checkInteractivity: !1,
|
14
19
|
content: r,
|
15
|
-
children: /* @__PURE__ */ t(
|
16
|
-
render: /* @__PURE__ */ t(
|
17
|
-
as:
|
20
|
+
children: /* @__PURE__ */ t(n, {
|
21
|
+
render: /* @__PURE__ */ t(s, {
|
22
|
+
as: o,
|
23
|
+
className: m(l.interactiveText, i),
|
18
24
|
...e,
|
19
|
-
children:
|
25
|
+
children: c
|
20
26
|
})
|
21
27
|
})
|
22
28
|
});
|
23
29
|
};
|
24
30
|
export {
|
25
|
-
|
31
|
+
d as default
|
26
32
|
};
|
@@ -1,64 +1,71 @@
|
|
1
|
-
import { DateI18nProvider as
|
2
|
-
import { useFormikContext as F, getIn as
|
3
|
-
import { useMemo as
|
4
|
-
import { useIntl as
|
5
|
-
import { convertToDatePickerValue as
|
6
|
-
import { useDateInternationalization as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
import { DateI18nProvider as T, DatePicker as P } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as F, getIn as V, Field as b } from "formik";
|
3
|
+
import { useMemo as A } from "react";
|
4
|
+
import { useIntl as C } from "react-intl";
|
5
|
+
import { convertToDatePickerValue as I, convertToFormikValue as L } from "./date-conversion-utils.js";
|
6
|
+
import { useDateInternationalization as w } from "./use-date-internationalization.js";
|
7
|
+
import a from "../../../../messages.js";
|
8
|
+
import N from "../../../interactive-text/interactive-text.js";
|
9
|
+
import { jsx as o } from "react/jsx-runtime";
|
10
|
+
const G = ({
|
11
|
+
description: s,
|
12
|
+
disableForm: m,
|
13
|
+
fieldNamePrefix: d,
|
14
|
+
label: r,
|
15
|
+
portalElement: f,
|
14
16
|
className: u
|
15
17
|
}) => {
|
16
|
-
const
|
17
|
-
values:
|
18
|
-
setFieldTouched:
|
19
|
-
setFieldValue:
|
18
|
+
const t = `${d}.value`, e = C(), {
|
19
|
+
values: h,
|
20
|
+
setFieldTouched: p,
|
21
|
+
setFieldValue: D
|
20
22
|
} = F(), {
|
21
|
-
localTimezone:
|
22
|
-
} =
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
p(
|
32
|
-
}, k = () => {
|
33
|
-
h(a, !0);
|
23
|
+
localTimezone: M
|
24
|
+
} = w(e.locale), c = V(h, t), g = A(() => I(c), [c]), k = {
|
25
|
+
clearDatePickerAriaLabel: e.formatMessage(a.clearSelectedDate),
|
26
|
+
nextMonthAriaLabel: e.formatMessage(a.switchToNextMonth),
|
27
|
+
openCalendarDropdownAriaLabel: e.formatMessage(a.openCalendar),
|
28
|
+
previousMonthAriaLabel: e.formatMessage(a.switchToNextMonth)
|
29
|
+
}, v = (n) => {
|
30
|
+
const l = L(n, M);
|
31
|
+
D(t, l);
|
32
|
+
}, x = () => {
|
33
|
+
p(t, !0);
|
34
34
|
};
|
35
|
-
return /* @__PURE__ */
|
36
|
-
"data-testid": `${
|
37
|
-
children: /* @__PURE__ */
|
35
|
+
return /* @__PURE__ */ o("div", {
|
36
|
+
"data-testid": `${r}-field`,
|
37
|
+
children: /* @__PURE__ */ o(T, {
|
38
38
|
locale: e.locale,
|
39
|
-
children: /* @__PURE__ */
|
40
|
-
name:
|
39
|
+
children: /* @__PURE__ */ o(b, {
|
40
|
+
name: t,
|
41
41
|
children: ({
|
42
|
-
field:
|
43
|
-
meta:
|
44
|
-
}) => /* @__PURE__ */
|
45
|
-
...
|
46
|
-
...
|
47
|
-
calendarAriaLabel: e.formatMessage(
|
42
|
+
field: n,
|
43
|
+
meta: l
|
44
|
+
}) => /* @__PURE__ */ o(P, {
|
45
|
+
...n,
|
46
|
+
...k,
|
47
|
+
calendarAriaLabel: e.formatMessage(a.selectDate),
|
48
48
|
className: u,
|
49
|
-
error:
|
50
|
-
isDisabled:
|
51
|
-
label:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
49
|
+
error: l.error,
|
50
|
+
isDisabled: m,
|
51
|
+
label: s ? ({
|
52
|
+
...i
|
53
|
+
}) => N({
|
54
|
+
as: "span",
|
55
|
+
tooltipText: s,
|
56
|
+
children: r,
|
57
|
+
...i
|
58
|
+
}) : r,
|
59
|
+
onBlur: () => x(),
|
60
|
+
onChange: (i) => v(i),
|
61
|
+
portalElement: f,
|
62
|
+
value: g
|
56
63
|
})
|
57
64
|
})
|
58
65
|
})
|
59
66
|
});
|
60
67
|
};
|
61
68
|
export {
|
62
|
-
|
63
|
-
|
69
|
+
G as MetadataDateField,
|
70
|
+
G as default
|
64
71
|
};
|
@@ -1,47 +1,56 @@
|
|
1
|
-
import { Select as l, SELECT_EMPTY_VALUE as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { useIntl as
|
1
|
+
import { Select as l, SELECT_EMPTY_VALUE as s } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as E, getIn as F, Field as M } from "formik";
|
3
|
+
import { useIntl as V, FormattedMessage as C } from "react-intl";
|
4
4
|
import d from "../../../../messages.js";
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
import T from "../../../interactive-text/interactive-text.js";
|
6
|
+
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
7
|
+
const A = ({
|
8
|
+
className: i,
|
9
|
+
description: n,
|
10
|
+
disableForm: h,
|
11
|
+
fieldNamePrefix: c,
|
12
|
+
label: r,
|
13
|
+
options: v,
|
14
|
+
portalElement: p
|
13
15
|
}) => {
|
14
16
|
const {
|
15
|
-
setFieldValue:
|
16
|
-
values:
|
17
|
-
} =
|
17
|
+
setFieldValue: x,
|
18
|
+
values: f
|
19
|
+
} = E(), g = V(), m = `${c}.value`, o = v || F(f, `${c}.options`, []).map(({
|
18
20
|
key: a
|
19
|
-
}) => a), u =
|
21
|
+
}) => a), u = g.formatMessage(d.selectValuePlaceholder);
|
20
22
|
return /* @__PURE__ */ t("div", {
|
21
|
-
"data-testid": `${
|
22
|
-
children: /* @__PURE__ */ t(
|
23
|
-
name:
|
23
|
+
"data-testid": `${r}-field`,
|
24
|
+
children: /* @__PURE__ */ t(M, {
|
25
|
+
name: m,
|
24
26
|
children: ({
|
25
27
|
field: a
|
26
28
|
}) => /* @__PURE__ */ t(l, {
|
27
|
-
className:
|
28
|
-
disabled:
|
29
|
-
label:
|
29
|
+
className: i,
|
30
|
+
disabled: h,
|
31
|
+
label: n ? ({
|
32
|
+
...e
|
33
|
+
}) => T({
|
34
|
+
as: "label",
|
35
|
+
tooltipText: n,
|
36
|
+
children: r,
|
37
|
+
...e
|
38
|
+
}) : r,
|
30
39
|
onValueChange: (e) => {
|
31
|
-
|
40
|
+
x(m, e === s ? "" : e);
|
32
41
|
},
|
33
42
|
placeholder: u,
|
34
43
|
...a,
|
35
|
-
value: a.value ===
|
36
|
-
children: /* @__PURE__ */
|
37
|
-
container:
|
44
|
+
value: a.value === s ? "" : a.value,
|
45
|
+
children: /* @__PURE__ */ I(l.Content, {
|
46
|
+
container: p,
|
38
47
|
children: [/* @__PURE__ */ t(l.Option, {
|
39
48
|
text: u,
|
40
|
-
value:
|
41
|
-
children: /* @__PURE__ */ t(
|
49
|
+
value: s,
|
50
|
+
children: /* @__PURE__ */ t(C, {
|
42
51
|
...d.selectValuePlaceholder
|
43
52
|
})
|
44
|
-
}),
|
53
|
+
}), o == null ? void 0 : o.map((e) => /* @__PURE__ */ t(l.Option, {
|
45
54
|
text: e,
|
46
55
|
value: e,
|
47
56
|
children: e
|
@@ -52,6 +61,6 @@ const T = ({
|
|
52
61
|
});
|
53
62
|
};
|
54
63
|
export {
|
55
|
-
|
56
|
-
|
64
|
+
A as MetadataEnumField,
|
65
|
+
A as default
|
57
66
|
};
|
@@ -1,49 +1,58 @@
|
|
1
|
-
import { TextInput as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { useRef as
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import { TextInput as x } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as T, getIn as g, Field as C } from "formik";
|
3
|
+
import { useRef as I } from "react";
|
4
|
+
import V from "../../../interactive-text/interactive-text.js";
|
5
|
+
import { fieldDefaultProps as $ } from "../constants.js";
|
6
|
+
import { useFloatValidation as B } from "./use-float-validation.js";
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
8
|
+
const N = ({
|
9
|
+
className: i,
|
10
|
+
description: l,
|
11
|
+
label: r,
|
12
|
+
fieldNamePrefix: d,
|
13
|
+
disableForm: s
|
12
14
|
}) => {
|
13
15
|
const {
|
14
|
-
values:
|
15
|
-
setFieldValue:
|
16
|
-
setFieldTouched:
|
17
|
-
} =
|
18
|
-
validateFloats:
|
19
|
-
} =
|
20
|
-
|
21
|
-
},
|
22
|
-
|
16
|
+
values: u,
|
17
|
+
setFieldValue: m,
|
18
|
+
setFieldTouched: c
|
19
|
+
} = T(), t = `${d}.value`, f = g(u, t), n = I(f), {
|
20
|
+
validateFloats: p
|
21
|
+
} = B(), h = (e) => {
|
22
|
+
n.current = e, m(t, e);
|
23
|
+
}, F = (e) => {
|
24
|
+
c(e, !0);
|
23
25
|
};
|
24
|
-
return /* @__PURE__ */
|
25
|
-
"data-testid": `${
|
26
|
-
children: /* @__PURE__ */
|
26
|
+
return /* @__PURE__ */ a("div", {
|
27
|
+
"data-testid": `${r}-field`,
|
28
|
+
children: /* @__PURE__ */ a(C, {
|
27
29
|
name: `${t}`,
|
28
|
-
validate: () =>
|
30
|
+
validate: () => p(n.current),
|
29
31
|
children: ({
|
30
32
|
field: e,
|
31
|
-
meta:
|
32
|
-
}) => /* @__PURE__ */
|
33
|
-
|
33
|
+
meta: v
|
34
|
+
}) => /* @__PURE__ */ a(x, {
|
35
|
+
...$,
|
34
36
|
...e,
|
35
37
|
className: i,
|
36
|
-
disabled:
|
37
|
-
error:
|
38
|
-
label:
|
39
|
-
|
40
|
-
|
38
|
+
disabled: s,
|
39
|
+
error: v.error,
|
40
|
+
label: l ? ({
|
41
|
+
...o
|
42
|
+
}) => V({
|
43
|
+
as: "label",
|
44
|
+
tooltipText: l,
|
45
|
+
children: r,
|
46
|
+
...o
|
47
|
+
}) : r,
|
48
|
+
onBlur: () => F(t),
|
49
|
+
onChange: (o) => h(o.currentTarget.value),
|
41
50
|
placeholder: "0"
|
42
51
|
})
|
43
52
|
})
|
44
53
|
});
|
45
54
|
};
|
46
55
|
export {
|
47
|
-
|
48
|
-
|
56
|
+
N as MetadataFloatField,
|
57
|
+
N as default
|
49
58
|
};
|
@@ -1,45 +1,54 @@
|
|
1
|
-
import { TooltipProvider as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { useIntl as
|
4
|
-
import
|
5
|
-
import
|
1
|
+
import { TooltipProvider as F, Combobox as g } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as x, getIn as C, Field as b } from "formik";
|
3
|
+
import { useIntl as I } from "react-intl";
|
4
|
+
import M from "../../../../messages.js";
|
5
|
+
import T from "../../../interactive-text/interactive-text.js";
|
6
|
+
import { fieldDefaultProps as $ } from "../constants.js";
|
6
7
|
import { jsx as o } from "react/jsx-runtime";
|
7
|
-
const
|
8
|
+
const O = ({
|
8
9
|
className: s,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
description: a,
|
11
|
+
disableForm: m,
|
12
|
+
fieldNamePrefix: i,
|
13
|
+
label: l,
|
14
|
+
portalElement: u,
|
15
|
+
options: d
|
14
16
|
}) => {
|
15
17
|
const {
|
16
|
-
setFieldValue:
|
17
|
-
values:
|
18
|
-
} =
|
18
|
+
setFieldValue: c,
|
19
|
+
values: p
|
20
|
+
} = x(), f = I(), n = `${i}.value`, h = d || C(p, `${i}.options`, []).map(({
|
19
21
|
key: e
|
20
|
-
}) => e),
|
22
|
+
}) => e), v = (e, t) => t.toLowerCase().includes(e.toLowerCase());
|
21
23
|
return /* @__PURE__ */ o("div", {
|
22
|
-
"data-testid": `${
|
23
|
-
children: /* @__PURE__ */ o(
|
24
|
-
name:
|
24
|
+
"data-testid": `${l}-field`,
|
25
|
+
children: /* @__PURE__ */ o(b, {
|
26
|
+
name: n,
|
25
27
|
children: ({
|
26
28
|
field: e
|
27
29
|
}) => {
|
28
30
|
var t;
|
29
|
-
return /* @__PURE__ */ o(
|
30
|
-
children: /* @__PURE__ */ o(
|
31
|
-
|
31
|
+
return /* @__PURE__ */ o(F, {
|
32
|
+
children: /* @__PURE__ */ o(g, {
|
33
|
+
...$,
|
32
34
|
as: "input",
|
33
35
|
className: s,
|
34
|
-
disabled:
|
35
|
-
filterFn:
|
36
|
-
label:
|
36
|
+
disabled: m,
|
37
|
+
filterFn: v,
|
38
|
+
label: a ? ({
|
39
|
+
...r
|
40
|
+
}) => T({
|
41
|
+
as: "label",
|
42
|
+
tooltipText: a,
|
43
|
+
children: l,
|
44
|
+
...r
|
45
|
+
}) : l,
|
37
46
|
multiselect: !0,
|
38
47
|
name: e.name,
|
39
|
-
onValueChange: (
|
40
|
-
options:
|
41
|
-
placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ?
|
42
|
-
portalElement:
|
48
|
+
onValueChange: (r) => c(n, r),
|
49
|
+
options: h,
|
50
|
+
placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? f.formatMessage(M.multiselectPlaceholder) : "",
|
51
|
+
portalElement: u,
|
43
52
|
value: e.value
|
44
53
|
})
|
45
54
|
});
|
@@ -48,6 +57,6 @@ const k = ({
|
|
48
57
|
});
|
49
58
|
};
|
50
59
|
export {
|
51
|
-
|
52
|
-
|
60
|
+
O as MetadataMultiSelectField,
|
61
|
+
O as default
|
53
62
|
};
|
@@ -1,37 +1,46 @@
|
|
1
|
-
import { TextInput as
|
2
|
-
import { Field as
|
3
|
-
import { useIntl as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import { TextInput as n } from "@box/blueprint-web";
|
2
|
+
import { Field as p } from "formik";
|
3
|
+
import { useIntl as c } from "react-intl";
|
4
|
+
import u from "../../../../messages.js";
|
5
|
+
import h from "../../../interactive-text/interactive-text.js";
|
6
|
+
import { fieldDefaultProps as x } from "../constants.js";
|
7
|
+
import { jsx as t } from "react/jsx-runtime";
|
8
|
+
const g = ({
|
9
|
+
description: r,
|
10
|
+
label: e,
|
11
|
+
fieldNamePrefix: a,
|
12
|
+
disableForm: o,
|
13
|
+
className: i
|
12
14
|
}) => {
|
13
|
-
const
|
14
|
-
return /* @__PURE__ */
|
15
|
-
"data-testid": `${
|
16
|
-
children: /* @__PURE__ */
|
15
|
+
const l = c(), d = `${a}.value`;
|
16
|
+
return /* @__PURE__ */ t("div", {
|
17
|
+
"data-testid": `${e}-field`,
|
18
|
+
children: /* @__PURE__ */ t(p, {
|
17
19
|
name: d,
|
18
20
|
children: ({
|
19
|
-
field:
|
20
|
-
meta:
|
21
|
-
}) => /* @__PURE__ */
|
22
|
-
...
|
23
|
-
...
|
24
|
-
className:
|
25
|
-
disabled:
|
26
|
-
error:
|
27
|
-
label: r
|
28
|
-
|
21
|
+
field: m,
|
22
|
+
meta: s
|
23
|
+
}) => /* @__PURE__ */ t(n, {
|
24
|
+
...x,
|
25
|
+
...m,
|
26
|
+
className: i,
|
27
|
+
disabled: o,
|
28
|
+
error: s.error,
|
29
|
+
label: r ? ({
|
30
|
+
...f
|
31
|
+
}) => h({
|
32
|
+
as: "label",
|
33
|
+
tooltipText: r,
|
34
|
+
children: e,
|
35
|
+
...f
|
36
|
+
}) : e,
|
37
|
+
placeholder: l.formatMessage(u.setValuePlaceholder)
|
29
38
|
})
|
30
39
|
})
|
31
40
|
});
|
32
41
|
};
|
33
|
-
|
42
|
+
g.displayName = "MetadataStringField";
|
34
43
|
export {
|
35
|
-
|
36
|
-
|
44
|
+
g as MetadataStringField,
|
45
|
+
g as default
|
37
46
|
};
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-entry.css";
|
2
2
|
import { Text as o } from "@box/blueprint-web";
|
3
|
-
import { FormattedDate as
|
4
|
-
import { convertISOStringToUTCDate as
|
5
|
-
import
|
6
|
-
import { jsxs as
|
7
|
-
const
|
8
|
-
metadataInstanceEntry:
|
9
|
-
|
10
|
-
|
11
|
-
description: r,
|
3
|
+
import { FormattedDate as s } from "react-intl";
|
4
|
+
import { convertISOStringToUTCDate as d } from "./convertDate.js";
|
5
|
+
import f from "../../../interactive-text/interactive-text.js";
|
6
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
7
|
+
const l = "_metadataInstanceEntry_gwoh6_1", p = {
|
8
|
+
metadataInstanceEntry: l
|
9
|
+
}, S = ({
|
10
|
+
description: a,
|
12
11
|
name: e,
|
13
12
|
shouldHideEmptyValues: i,
|
14
|
-
type:
|
13
|
+
type: c,
|
15
14
|
value: t
|
16
15
|
}) => {
|
17
16
|
const n = (() => {
|
@@ -21,9 +20,9 @@ const I = "_metadataInstanceEntry_1qhk8_1", p = "_metadataInstanceEntryInteracti
|
|
21
20
|
return null;
|
22
21
|
if (Array.isArray(t))
|
23
22
|
return t.join(", ");
|
24
|
-
if (
|
25
|
-
const m =
|
26
|
-
return /* @__PURE__ */
|
23
|
+
if (c === "date" && typeof t == "string") {
|
24
|
+
const m = d(t);
|
25
|
+
return /* @__PURE__ */ r(s, {
|
27
26
|
day: "numeric",
|
28
27
|
month: "long",
|
29
28
|
value: m,
|
@@ -32,26 +31,25 @@ const I = "_metadataInstanceEntry_1qhk8_1", p = "_metadataInstanceEntryInteracti
|
|
32
31
|
}
|
33
32
|
return t;
|
34
33
|
})();
|
35
|
-
return i && !n ? null : /* @__PURE__ */
|
36
|
-
className:
|
37
|
-
children: [/* @__PURE__ */
|
34
|
+
return i && !n ? null : /* @__PURE__ */ y("div", {
|
35
|
+
className: p.metadataInstanceEntry,
|
36
|
+
children: [/* @__PURE__ */ r(o, {
|
38
37
|
as: "p",
|
39
38
|
color: "textOnLightSecondary",
|
40
39
|
variant: "bodyDefaultBold",
|
41
|
-
children:
|
40
|
+
children: a ? /* @__PURE__ */ r(f, {
|
42
41
|
as: "span",
|
43
|
-
className: c.metadataInstanceEntryInteractiveLabel,
|
44
42
|
color: "textOnLightSecondary",
|
45
|
-
tooltipText:
|
43
|
+
tooltipText: a,
|
46
44
|
variant: "bodyDefaultBold",
|
47
45
|
children: e
|
48
46
|
}) : e
|
49
|
-
}), n && /* @__PURE__ */
|
47
|
+
}), n && /* @__PURE__ */ r(o, {
|
50
48
|
as: "p",
|
51
49
|
children: n
|
52
50
|
})]
|
53
51
|
});
|
54
52
|
};
|
55
53
|
export {
|
56
|
-
|
54
|
+
S as MetadataInstanceEntry
|
57
55
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.51.
|
3
|
+
"version": "0.51.2",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.20.0",
|
@@ -52,5 +52,5 @@
|
|
52
52
|
"**/*.css"
|
53
53
|
],
|
54
54
|
"license": "SEE LICENSE IN LICENSE",
|
55
|
-
"gitHead": "
|
55
|
+
"gitHead": "fd714816101aaeb678900361350e92c6372cd03f"
|
56
56
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
._interactiveText_2jv0p_1{text-decoration:dashed underline var(--gray-50) .5px!important;text-underline-offset:2px;width:fit-content}._interactiveText_2jv0p_1:hover{color:var(--gray-100);text-decoration-color:var(--gray-100)!important}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._metadataInstanceEntry_gwoh6_1{display:flex;flex-direction:column;gap:var(--space-2)}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { type TextProps } from '@box/blueprint-web';
|
2
2
|
export type InteractiveTextProps = TextProps & {
|
3
|
+
className?: string;
|
3
4
|
tooltipText: string;
|
4
5
|
};
|
5
6
|
/**
|
6
7
|
* Wrapper component for displaying tooltip content on focusing text nodes
|
7
8
|
*/
|
8
|
-
declare const InteractiveText: ({ tooltipText, children, ...props }: InteractiveTextProps) => import("react/jsx-runtime").JSX.Element;
|
9
|
+
declare const InteractiveText: ({ tooltipText, className, children, ...props }: InteractiveTextProps) => import("react/jsx-runtime").JSX.Element;
|
9
10
|
export default InteractiveText;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type MetadataFieldProps } from '../../types';
|
2
|
-
export declare const MetadataDateField: ({ disableForm, fieldNamePrefix, label, portalElement, className, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataDateField: ({ description, disableForm, fieldNamePrefix, label, portalElement, className, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default MetadataDateField;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type MetadataFieldProps } from '../../types';
|
2
|
-
export declare const MetadataEnumField: ({ className, disableForm, fieldNamePrefix, label, options, portalElement, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataEnumField: ({ className, description, disableForm, fieldNamePrefix, label, options, portalElement, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default MetadataEnumField;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type MetadataFieldProps } from '../../types';
|
2
|
-
export declare const MetadataFloatField: ({ label, fieldNamePrefix, disableForm,
|
2
|
+
export declare const MetadataFloatField: ({ className, description, label, fieldNamePrefix, disableForm, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default MetadataFloatField;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { type MetadataFieldProps } from '../../types';
|
2
|
-
export declare const MetadataMultiSelectField: ({ className, disableForm, fieldNamePrefix, label, portalElement, options, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataMultiSelectField: ({ className, description, disableForm, fieldNamePrefix, label, portalElement, options, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default MetadataMultiSelectField;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type MetadataFieldProps } from '../../types';
|
2
2
|
export declare const MetadataStringField: {
|
3
|
-
({ label, fieldNamePrefix, disableForm, className }: MetadataFieldProps): import("react/jsx-runtime").JSX.Element;
|
3
|
+
({ description, label, fieldNamePrefix, disableForm, className, }: MetadataFieldProps): import("react/jsx-runtime").JSX.Element;
|
4
4
|
displayName: string;
|
5
5
|
};
|
6
6
|
export default MetadataStringField;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type MetadataTemplate, type MetadataTemplateField, type MetadataTemplateInstance, type MetadataTemplateOption
|
1
|
+
import { type AutofillSuggestions, type MetadataTemplate, type MetadataTemplateField, type MetadataTemplateInstance, type MetadataTemplateOption } from '../types';
|
2
2
|
declare const stringField: MetadataTemplateField;
|
3
3
|
declare const dateField: MetadataTemplateField;
|
4
4
|
declare const enumField: MetadataTemplateField;
|