@box/metadata-editor 1.15.4 → 1.16.0
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/dist/chunks/filter-dropdown-menu.module.js +9 -12
- package/dist/chunks/metadata-instance-form-card-wrapper.js +32 -32
- package/dist/chunks/taxonomy-ancestor-status-pill.js +37 -38
- package/dist/chunks/types.js +3 -3
- package/dist/chunks/utils2.js +28 -30
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +93 -96
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +2 -2
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +3 -4
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +21 -24
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +59 -61
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +39 -40
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +37 -37
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +9 -9
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +35 -36
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +52 -52
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +22 -23
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +31 -32
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +22 -22
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +114 -114
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +96 -98
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +29 -29
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +39 -40
- package/dist/esm/lib/constants.js +3 -3
- package/dist/i18n/en-x-pseudo.js +129 -129
- package/dist/i18n/en-x-pseudo.properties +129 -129
- package/dist/styles/autofill-overlay.css +1 -1
- package/dist/styles/filter-dropdown-menu.css +1 -1
- package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
let C = /* @__PURE__ */ function(E) {
|
|
1
|
+
let C = /* @__PURE__ */ (function(E) {
|
|
2
2
|
return E.NOT_STARTED = "NOT_STARTED", E.IN_PROGRESS = "IN_PROGRESS", E.ERROR = "ERROR", E.SUCCESS = "SUCCESS", E.CANCELLED = "CANCELLED", E;
|
|
3
|
-
}({});
|
|
3
|
+
})({});
|
|
4
4
|
export {
|
|
5
5
|
C as RequestStates
|
|
6
6
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useReducer as O } from "react";
|
|
2
2
|
import { RequestStates as u } from "./request.js";
|
|
3
3
|
import { isAbortError as I } from "./utils/is-abort-error.js";
|
|
4
|
-
var s = /* @__PURE__ */ function(r) {
|
|
4
|
+
var s = /* @__PURE__ */ (function(r) {
|
|
5
5
|
return r.LOAD_MORE = "LOAD_MORE", r.RELOAD = "RELOAD", r.SEARCH = "SEARCH", r.SET_ERROR = "SET_ERROR", r.SET_LOADING = "SET_LOADING", r;
|
|
6
|
-
}(s || {});
|
|
6
|
+
})(s || {});
|
|
7
7
|
function a(r, e) {
|
|
8
8
|
switch (e.type) {
|
|
9
9
|
case s.LOAD_MORE:
|
|
@@ -63,8 +63,7 @@ function m(r, e) {
|
|
|
63
63
|
return E(r, e) || S(r, e);
|
|
64
64
|
}
|
|
65
65
|
function p(r, e) {
|
|
66
|
-
|
|
67
|
-
E(r, e) && e.abortController.abort(), S(r, e) && ((t = r.abortController) == null || t.abort());
|
|
66
|
+
E(r, e) && e.abortController.abort(), S(r, e) && r.abortController?.abort();
|
|
68
67
|
}
|
|
69
68
|
function h(r, e) {
|
|
70
69
|
return S(r, e);
|
package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as o from "react";
|
|
2
2
|
function a(e) {
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
}),
|
|
7
|
-
var t;
|
|
8
|
-
return (t = n.current) == null ? void 0 : t.call(n, ...o);
|
|
9
|
-
}, []);
|
|
3
|
+
const c = o.useRef(e);
|
|
4
|
+
return o.useEffect(() => {
|
|
5
|
+
c.current = e;
|
|
6
|
+
}), o.useMemo(() => (...t) => c.current?.(...t), []);
|
|
10
7
|
}
|
|
11
|
-
function
|
|
8
|
+
function v({
|
|
12
9
|
prop: e,
|
|
13
|
-
defaultProp:
|
|
14
|
-
onChange:
|
|
10
|
+
defaultProp: c,
|
|
11
|
+
onChange: t = () => {
|
|
15
12
|
}
|
|
16
13
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
defaultProp:
|
|
19
|
-
onChange:
|
|
20
|
-
}), r = e !== void 0, i = r ? e :
|
|
14
|
+
const [n, s] = R({
|
|
15
|
+
defaultProp: c,
|
|
16
|
+
onChange: t
|
|
17
|
+
}), r = e !== void 0, i = r ? e : n, l = a(t), d = o.useCallback((u) => {
|
|
21
18
|
if (r) {
|
|
22
19
|
const f = typeof u == "function" ? u(e) : u;
|
|
23
20
|
f !== e && l(f);
|
|
24
21
|
} else
|
|
25
|
-
|
|
26
|
-
}, [r, e,
|
|
22
|
+
s(u);
|
|
23
|
+
}, [r, e, s, l]);
|
|
27
24
|
return [i, d];
|
|
28
25
|
}
|
|
29
|
-
function
|
|
26
|
+
function R({
|
|
30
27
|
defaultProp: e,
|
|
31
|
-
onChange:
|
|
28
|
+
onChange: c
|
|
32
29
|
}) {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
}, [
|
|
30
|
+
const t = o.useState(e), [n] = t, s = o.useRef(n), r = a(c);
|
|
31
|
+
return o.useEffect(() => {
|
|
32
|
+
s.current !== n && (r(n), s.current = n);
|
|
33
|
+
}, [n, s, r]), t;
|
|
37
34
|
}
|
|
38
35
|
export {
|
|
39
|
-
|
|
36
|
+
v as useControllableState
|
|
40
37
|
};
|
package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js
CHANGED
|
@@ -1,87 +1,85 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const k = "0px",
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
root:
|
|
7
|
-
rootMargin:
|
|
8
|
-
threshold:
|
|
1
|
+
import { useState as y, useRef as R, useCallback as f } from "react";
|
|
2
|
+
const k = "0px", g = [0];
|
|
3
|
+
function C() {
|
|
4
|
+
const b = /* @__PURE__ */ new Map();
|
|
5
|
+
function a({
|
|
6
|
+
root: s,
|
|
7
|
+
rootMargin: t,
|
|
8
|
+
threshold: c
|
|
9
9
|
}) {
|
|
10
|
-
let r =
|
|
11
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
10
|
+
let r = b.get(s);
|
|
11
|
+
r || (r = /* @__PURE__ */ new Map(), b.set(s, r));
|
|
12
12
|
const i = JSON.stringify({
|
|
13
|
-
rootMargin:
|
|
14
|
-
threshold:
|
|
13
|
+
rootMargin: t,
|
|
14
|
+
threshold: c
|
|
15
15
|
});
|
|
16
|
-
let
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
observer: new IntersectionObserver((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
t == null || t(v);
|
|
16
|
+
let n = r.get(i);
|
|
17
|
+
if (!n) {
|
|
18
|
+
const e = /* @__PURE__ */ new Map();
|
|
19
|
+
n = {
|
|
20
|
+
observer: new IntersectionObserver((O) => {
|
|
21
|
+
O.forEach((v) => {
|
|
22
|
+
e.get(v.target)?.(v);
|
|
24
23
|
});
|
|
25
24
|
}, {
|
|
26
|
-
root:
|
|
27
|
-
rootMargin:
|
|
28
|
-
threshold:
|
|
25
|
+
root: s,
|
|
26
|
+
rootMargin: t,
|
|
27
|
+
threshold: c
|
|
29
28
|
}),
|
|
30
|
-
entryCallbacks:
|
|
31
|
-
}, r.set(i,
|
|
29
|
+
entryCallbacks: e
|
|
30
|
+
}, r.set(i, n);
|
|
32
31
|
}
|
|
33
32
|
return {
|
|
34
|
-
observe: (
|
|
35
|
-
|
|
33
|
+
observe: (e, l) => {
|
|
34
|
+
n?.entryCallbacks.set(e, l), n?.observer.observe(e);
|
|
36
35
|
},
|
|
37
|
-
unobserve: (
|
|
38
|
-
|
|
36
|
+
unobserve: (e) => {
|
|
37
|
+
n?.entryCallbacks.delete(e), n?.observer.unobserve(e);
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
41
|
return {
|
|
43
|
-
getObserver:
|
|
42
|
+
getObserver: a
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
|
|
45
|
+
const E = C();
|
|
46
|
+
function p(b) {
|
|
47
|
+
const a = b?.rootMargin ?? k, s = b?.threshold ?? g, t = R(null), c = R(null), r = R(null), [i, n] = y(), e = f(() => {
|
|
48
|
+
const o = t.current;
|
|
49
|
+
if (!o) {
|
|
50
|
+
n(void 0);
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
const
|
|
55
|
-
root:
|
|
56
|
-
rootMargin:
|
|
57
|
-
threshold:
|
|
53
|
+
const u = E.getObserver({
|
|
54
|
+
root: c.current,
|
|
55
|
+
rootMargin: a,
|
|
56
|
+
threshold: s
|
|
58
57
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}), r.current =
|
|
62
|
-
}, [
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
}, []),
|
|
66
|
-
l(),
|
|
67
|
-
}, [
|
|
68
|
-
l(),
|
|
69
|
-
}, [
|
|
70
|
-
return [
|
|
58
|
+
u.observe(o, (h) => {
|
|
59
|
+
n(h);
|
|
60
|
+
}), r.current = u;
|
|
61
|
+
}, [a, s]), l = f(() => {
|
|
62
|
+
const o = r.current, u = t.current;
|
|
63
|
+
u && o?.unobserve(u), r.current = null;
|
|
64
|
+
}, []), O = f((o) => {
|
|
65
|
+
l(), t.current = o, e();
|
|
66
|
+
}, [e, l]), v = f((o) => {
|
|
67
|
+
l(), c.current = o, e();
|
|
68
|
+
}, [e, l]);
|
|
69
|
+
return [O, {
|
|
71
70
|
entry: i,
|
|
72
71
|
rootRef: v
|
|
73
72
|
}];
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
wasEverVisible: u
|
|
74
|
+
function w(b) {
|
|
75
|
+
const [a, s] = p(b), t = !!s.entry?.isIntersecting, [c, r] = y(t);
|
|
76
|
+
return t && !c && r(!0), [a, {
|
|
77
|
+
...s,
|
|
78
|
+
isVisible: t,
|
|
79
|
+
wasEverVisible: c
|
|
82
80
|
}];
|
|
83
81
|
}
|
|
84
82
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
C as createObserverCache,
|
|
84
|
+
w as useTrackVisibility
|
|
87
85
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { TriggerButton as v, Text as
|
|
1
|
+
import { TriggerButton as v, Text as N, ScrollableContainer as C, Divider as j } from "@box/blueprint-web";
|
|
2
2
|
import { useIntl as x } from "react-intl";
|
|
3
3
|
import { SelectProvider as B, Select as b, SelectPopover as z, SelectItem as g, SelectItemCheck as I } from "@ariakit/react";
|
|
4
4
|
import { Space1 as k } from "@box/blueprint-web-assets/tokens/px-tokens";
|
|
5
5
|
import { useEffect as M } from "react";
|
|
6
6
|
import S from "clsx";
|
|
7
7
|
import { Checkmark as p } from "@box/blueprint-web-assets/icons/Fill";
|
|
8
|
-
import { getVisibleTemplates as y, getTemplateDisplayName as
|
|
8
|
+
import { getVisibleTemplates as y, getTemplateDisplayName as u } from "../../utils/utils.js";
|
|
9
9
|
import s from "./messages.js";
|
|
10
|
-
import { jsxs as o, jsx as
|
|
11
|
-
import '../../../../styles/filter-instances-dropdown.css';const D = "_details_106jz_2", w = "_triggerContainer_106jz_6", F = "_triggerButton_106jz_11", O = "_popover_106jz_17", P = "_divider_106jz_34", L = "_scrollableContainer_106jz_37", V = "_item_106jz_41", E = "_indicator_106jz_68", G = "_indicatorIcon_106jz_77",
|
|
10
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
11
|
+
import '../../../../styles/filter-instances-dropdown.css';const D = "_details_106jz_2", w = "_triggerContainer_106jz_6", F = "_triggerButton_106jz_11", O = "_popover_106jz_17", P = "_divider_106jz_34", L = "_scrollableContainer_106jz_37", V = "_item_106jz_41", E = "_indicator_106jz_68", G = "_indicatorIcon_106jz_77", e = {
|
|
12
12
|
details: D,
|
|
13
13
|
triggerContainer: w,
|
|
14
14
|
triggerButton: F,
|
|
@@ -17,78 +17,77 @@ import '../../../../styles/filter-instances-dropdown.css';const D = "_details_10
|
|
|
17
17
|
scrollableContainer: L,
|
|
18
18
|
item: V,
|
|
19
19
|
indicator: E,
|
|
20
|
-
indicatorIcon: G
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setSelectedTemplates: l
|
|
20
|
+
indicatorIcon: G
|
|
21
|
+
}, R = parseInt(k, 10);
|
|
22
|
+
function Z({
|
|
23
|
+
appliedTemplates: _,
|
|
24
|
+
selectedTemplates: l,
|
|
25
|
+
setSelectedTemplates: c
|
|
27
26
|
}) {
|
|
28
|
-
const a = x(), d = a.formatMessage(s.customMetadataName), n = y(
|
|
27
|
+
const a = x(), d = a.formatMessage(s.customMetadataName), n = y(_), i = l.length, m = n.length, h = i === 0 ? a.formatMessage(s.allTemplatesTriggerButtonText) : a.formatMessage(s.selectedTemplatesTriggerButtonText, {
|
|
29
28
|
selectedTemplatesNumber: i,
|
|
30
29
|
visibleTemplatesNumber: m
|
|
31
30
|
}), T = () => {
|
|
32
|
-
|
|
31
|
+
c([]);
|
|
33
32
|
};
|
|
34
33
|
return M(() => {
|
|
35
|
-
i === m &&
|
|
34
|
+
i === m && c([]);
|
|
36
35
|
}, [i, m]), /* @__PURE__ */ o(B, {
|
|
37
|
-
setValue:
|
|
38
|
-
value:
|
|
36
|
+
setValue: c,
|
|
37
|
+
value: l,
|
|
39
38
|
children: [/* @__PURE__ */ o("div", {
|
|
40
|
-
className:
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
-
render: /* @__PURE__ */
|
|
39
|
+
className: e.triggerContainer,
|
|
40
|
+
children: [/* @__PURE__ */ t(b, {
|
|
41
|
+
render: /* @__PURE__ */ t(v, {
|
|
43
42
|
caretDirection: "down",
|
|
44
|
-
className:
|
|
43
|
+
className: e.triggerButton,
|
|
45
44
|
label: h,
|
|
46
45
|
size: "small",
|
|
47
46
|
variant: "tertiary",
|
|
48
47
|
"data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
|
|
49
48
|
})
|
|
50
|
-
}), n.length > 0 && /* @__PURE__ */
|
|
49
|
+
}), n.length > 0 && /* @__PURE__ */ t(N, {
|
|
51
50
|
as: "p",
|
|
52
|
-
className:
|
|
51
|
+
className: e.details,
|
|
53
52
|
color: "textOnLightSecondary",
|
|
54
53
|
"data-testid": "detailsList",
|
|
55
54
|
variant: "caption",
|
|
56
|
-
children: n.filter((r) =>
|
|
55
|
+
children: n.filter((r) => l.some((f) => f === r.id)).map((r) => u(r, d)).join(", ")
|
|
57
56
|
})]
|
|
58
|
-
}), /* @__PURE__ */
|
|
59
|
-
className:
|
|
60
|
-
gutter:
|
|
61
|
-
children: /* @__PURE__ */ o(
|
|
62
|
-
className:
|
|
57
|
+
}), /* @__PURE__ */ t(z, {
|
|
58
|
+
className: e.popover,
|
|
59
|
+
gutter: R,
|
|
60
|
+
children: /* @__PURE__ */ o(C, {
|
|
61
|
+
className: e.scrollableContainer,
|
|
63
62
|
children: [/* @__PURE__ */ o(g, {
|
|
64
63
|
autoFocus: i === 0,
|
|
65
|
-
className:
|
|
64
|
+
className: e.item,
|
|
66
65
|
hideOnClick: !0,
|
|
67
66
|
onClick: T,
|
|
68
|
-
children: [i === 0 && /* @__PURE__ */
|
|
69
|
-
className: S(
|
|
67
|
+
children: [i === 0 && /* @__PURE__ */ t(p, {
|
|
68
|
+
className: S(e.indicator, e.indicatorIcon)
|
|
70
69
|
}), a.formatMessage(s.allTemplatesTriggerButtonText)]
|
|
71
|
-
}), /* @__PURE__ */
|
|
72
|
-
className:
|
|
70
|
+
}), /* @__PURE__ */ t(j, {
|
|
71
|
+
className: e.divider
|
|
73
72
|
}), n.map((r) => /* @__PURE__ */ o(g, {
|
|
74
|
-
className:
|
|
73
|
+
className: e.item,
|
|
75
74
|
hideOnClick: !0,
|
|
76
75
|
value: r.id,
|
|
77
|
-
children: [/* @__PURE__ */
|
|
78
|
-
className:
|
|
76
|
+
children: [/* @__PURE__ */ t(I, {
|
|
77
|
+
className: e.indicator,
|
|
79
78
|
style: {
|
|
80
79
|
width: "none",
|
|
81
80
|
height: "none"
|
|
82
81
|
},
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
-
className:
|
|
82
|
+
children: /* @__PURE__ */ t(p, {
|
|
83
|
+
className: e.indicatorIcon
|
|
85
84
|
})
|
|
86
|
-
}),
|
|
85
|
+
}), u(r, d)]
|
|
87
86
|
}, r.id))]
|
|
88
87
|
})
|
|
89
88
|
})]
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
Z as FilterInstancesDropdown
|
|
94
93
|
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { Select as l, SELECT_EMPTY_VALUE as o } from "@box/blueprint-web";
|
|
2
|
-
import { useFormikContext as C, getIn as L, Field as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { g as
|
|
7
|
-
import { jsx as t, jsxs as
|
|
8
|
-
const U = /* @__PURE__ */
|
|
9
|
-
className:
|
|
10
|
-
isAiSuggestionApplied:
|
|
11
|
-
description:
|
|
12
|
-
disableForm:
|
|
13
|
-
fieldNamePrefix:
|
|
14
|
-
updateModePrefix:
|
|
15
|
-
label:
|
|
16
|
-
onValueEdited:
|
|
17
|
-
options:
|
|
18
|
-
portalElement:
|
|
19
|
-
},
|
|
2
|
+
import { useFormikContext as C, getIn as L, Field as O } from "formik";
|
|
3
|
+
import { forwardRef as P } from "react";
|
|
4
|
+
import { useIntl as S, FormattedMessage as $ } from "react-intl";
|
|
5
|
+
import i from "../../../../messages.js";
|
|
6
|
+
import { g as b } from "../../../../../../chunks/utils2.js";
|
|
7
|
+
import { jsx as t, jsxs as j } from "react/jsx-runtime";
|
|
8
|
+
const U = /* @__PURE__ */ P(({
|
|
9
|
+
className: m,
|
|
10
|
+
isAiSuggestionApplied: c,
|
|
11
|
+
description: u,
|
|
12
|
+
disableForm: p,
|
|
13
|
+
fieldNamePrefix: r,
|
|
14
|
+
updateModePrefix: f,
|
|
15
|
+
label: s,
|
|
16
|
+
onValueEdited: g,
|
|
17
|
+
options: h,
|
|
18
|
+
portalElement: v
|
|
19
|
+
}, E) => {
|
|
20
20
|
const {
|
|
21
|
-
setFieldValue:
|
|
22
|
-
values:
|
|
23
|
-
} = C(),
|
|
21
|
+
setFieldValue: F,
|
|
22
|
+
values: M
|
|
23
|
+
} = C(), x = S(), n = `${f ?? r}.value`, V = h || L(M, `${r}.options`, []).map(({
|
|
24
24
|
key: a
|
|
25
|
-
}) => a),
|
|
25
|
+
}) => a), d = x.formatMessage(i.selectValuePlaceholder);
|
|
26
26
|
return /* @__PURE__ */ t("div", {
|
|
27
|
-
"data-testid": `${
|
|
28
|
-
children: /* @__PURE__ */ t(
|
|
29
|
-
name:
|
|
27
|
+
"data-testid": `${s}-field`,
|
|
28
|
+
children: /* @__PURE__ */ t(O, {
|
|
29
|
+
name: n,
|
|
30
30
|
children: ({
|
|
31
31
|
field: a
|
|
32
32
|
}) => /* @__PURE__ */ t(l, {
|
|
33
|
-
ref:
|
|
34
|
-
className:
|
|
33
|
+
ref: E,
|
|
34
|
+
className: m,
|
|
35
35
|
"data-target-id": "Select-MetadataEditorEnumField",
|
|
36
|
-
disabled:
|
|
37
|
-
label:
|
|
36
|
+
disabled: p,
|
|
37
|
+
label: b(s, u, c),
|
|
38
38
|
onValueChange: (e) => {
|
|
39
|
-
|
|
39
|
+
F(n, e === o ? "" : e), g();
|
|
40
40
|
},
|
|
41
|
-
placeholder:
|
|
41
|
+
placeholder: d,
|
|
42
42
|
...a,
|
|
43
43
|
value: a.value === o ? "" : a.value,
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
container:
|
|
44
|
+
children: /* @__PURE__ */ j(l.Content, {
|
|
45
|
+
container: v,
|
|
46
46
|
onEscapeKeyDown: (e) => e.stopPropagation(),
|
|
47
47
|
children: [/* @__PURE__ */ t(l.Option, {
|
|
48
|
-
text:
|
|
48
|
+
text: d,
|
|
49
49
|
value: o,
|
|
50
|
-
children: /* @__PURE__ */ t(
|
|
51
|
-
...
|
|
50
|
+
children: /* @__PURE__ */ t($, {
|
|
51
|
+
...i.selectValuePlaceholder
|
|
52
52
|
})
|
|
53
|
-
}),
|
|
53
|
+
}), V?.map((e) => /* @__PURE__ */ t(l.Option, {
|
|
54
54
|
text: e,
|
|
55
55
|
value: e,
|
|
56
56
|
children: e
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
const t =
|
|
1
|
+
import { useIntl as r } from "react-intl";
|
|
2
|
+
import o from "../../../../messages.js";
|
|
3
|
+
const a = (t) => t?.length ? /^[-+]?\d+(\.\d+)?$/.test(t) : !0, i = () => {
|
|
4
|
+
const t = r();
|
|
5
5
|
return {
|
|
6
|
-
validateFloats: (
|
|
7
|
-
if (!
|
|
8
|
-
return t.formatMessage(
|
|
6
|
+
validateFloats: (e) => {
|
|
7
|
+
if (!a(e))
|
|
8
|
+
return t.formatMessage(o.floatFieldInvalidValue);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
a as isFloatOrBlank,
|
|
14
|
+
i as useFloatValidation
|
|
15
15
|
};
|
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import { Combobox as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { g as
|
|
1
|
+
import { Combobox as M } from "@box/blueprint-web";
|
|
2
|
+
import { useFormikContext as x, getIn as V, Field as w } from "formik";
|
|
3
|
+
import { forwardRef as $ } from "react";
|
|
4
|
+
import { useIntl as I } from "react-intl";
|
|
5
|
+
import S from "../../../../messages.js";
|
|
6
|
+
import { g as j } from "../../../../../../chunks/utils2.js";
|
|
7
7
|
import { jsx as t } from "react/jsx-runtime";
|
|
8
|
-
const
|
|
9
|
-
className:
|
|
10
|
-
isAiSuggestionApplied:
|
|
11
|
-
description:
|
|
12
|
-
disableForm:
|
|
8
|
+
const A = /* @__PURE__ */ $(({
|
|
9
|
+
className: i,
|
|
10
|
+
isAiSuggestionApplied: n,
|
|
11
|
+
description: s,
|
|
12
|
+
disableForm: m,
|
|
13
13
|
fieldNamePrefix: o,
|
|
14
14
|
label: a,
|
|
15
|
-
onValueEdited:
|
|
16
|
-
options:
|
|
17
|
-
portalElement:
|
|
18
|
-
updateModePrefix:
|
|
19
|
-
},
|
|
15
|
+
onValueEdited: d,
|
|
16
|
+
options: u,
|
|
17
|
+
portalElement: c,
|
|
18
|
+
updateModePrefix: f
|
|
19
|
+
}, p) => {
|
|
20
20
|
const {
|
|
21
|
-
setFieldValue:
|
|
22
|
-
values:
|
|
23
|
-
} =
|
|
21
|
+
setFieldValue: g,
|
|
22
|
+
values: h
|
|
23
|
+
} = x(), F = I(), l = `${f ?? o}.value`, b = u || V(h, `${o}.options`, []).map(({
|
|
24
24
|
key: e
|
|
25
|
-
}) => e),
|
|
25
|
+
}) => e), v = (e, r) => r.toLowerCase().includes(e.toLowerCase());
|
|
26
26
|
return /* @__PURE__ */ t("div", {
|
|
27
27
|
"data-testid": `${a}-field`,
|
|
28
|
-
children: /* @__PURE__ */ t(
|
|
28
|
+
children: /* @__PURE__ */ t(w, {
|
|
29
29
|
name: l,
|
|
30
30
|
children: ({
|
|
31
31
|
field: e
|
|
32
32
|
}) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ref: g,
|
|
33
|
+
const C = (e.value?.length || 0) === 0 ? F.formatMessage(S.multiselectPlaceholder) : "";
|
|
34
|
+
return /* @__PURE__ */ t(M, {
|
|
35
|
+
ref: p,
|
|
37
36
|
as: "input",
|
|
38
|
-
className:
|
|
37
|
+
className: i,
|
|
39
38
|
"data-target-id": "Combobox-MetadataEditorMultiSelectField",
|
|
40
|
-
disabled:
|
|
41
|
-
filterFn:
|
|
42
|
-
label:
|
|
39
|
+
disabled: m,
|
|
40
|
+
filterFn: v,
|
|
41
|
+
label: j(a, s, n),
|
|
43
42
|
multiselect: !0,
|
|
44
43
|
name: e.name,
|
|
45
|
-
onValueChange: (
|
|
46
|
-
|
|
44
|
+
onValueChange: (L) => {
|
|
45
|
+
g(l, L), d();
|
|
47
46
|
},
|
|
48
|
-
options:
|
|
49
|
-
placeholder:
|
|
50
|
-
portalElement:
|
|
47
|
+
options: b,
|
|
48
|
+
placeholder: C,
|
|
49
|
+
portalElement: c,
|
|
51
50
|
value: e.value
|
|
52
51
|
});
|
|
53
52
|
}
|
|
@@ -55,6 +54,6 @@ const B = /* @__PURE__ */ I(({
|
|
|
55
54
|
});
|
|
56
55
|
});
|
|
57
56
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
A as MetadataMultiSelectField,
|
|
58
|
+
A as default
|
|
60
59
|
};
|