@box/metadata-view 0.50.0 → 0.51.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.
|
@@ -1,98 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { V as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useMemo as i } from "react";
|
|
2
|
+
import { useIntl as s } from "react-intl";
|
|
3
|
+
import { IconButton as C, DropdownMenu as t, GridList as _ } from "@box/blueprint-web";
|
|
4
|
+
import { Ellipsis as b } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { V as d } from "../../../../chunks/types.js";
|
|
6
|
+
import L from "./messages.js";
|
|
7
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
8
|
+
import '../../../../styles/item-action-menu.css';const x = "_tableActionBar_akgtp_1", N = "_actionItemIcon_akgtp_6", S = {
|
|
9
|
+
tableActionBar: x,
|
|
10
|
+
actionItemIcon: N
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
-
item:
|
|
13
|
-
label:
|
|
14
|
-
onClick:
|
|
15
|
-
icon:
|
|
12
|
+
function T({
|
|
13
|
+
item: e,
|
|
14
|
+
label: n,
|
|
15
|
+
onClick: p,
|
|
16
|
+
icon: o,
|
|
17
|
+
isDisabled: l
|
|
16
18
|
}) {
|
|
17
19
|
const I = () => {
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
p(e);
|
|
21
|
+
}, f = i(() => (l == null ? void 0 : l(e)) ?? !1, [l, e]);
|
|
22
|
+
return /* @__PURE__ */ m(t.Item, {
|
|
23
|
+
disabled: f,
|
|
21
24
|
onClick: I,
|
|
22
|
-
children: [/* @__PURE__ */ o
|
|
23
|
-
className:
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
25
|
+
children: [/* @__PURE__ */ r(o, {
|
|
26
|
+
className: S.actionItemIcon
|
|
27
|
+
}), n]
|
|
28
|
+
}, n);
|
|
26
29
|
}
|
|
27
|
-
function
|
|
28
|
-
actions:
|
|
29
|
-
inlineActions:
|
|
30
|
-
isDisabled:
|
|
31
|
-
item:
|
|
32
|
-
onOpenChange:
|
|
33
|
-
subMenuActions:
|
|
34
|
-
subMenuTrigger:
|
|
35
|
-
viewMode:
|
|
30
|
+
function E({
|
|
31
|
+
actions: e,
|
|
32
|
+
inlineActions: n,
|
|
33
|
+
isDisabled: p,
|
|
34
|
+
item: o,
|
|
35
|
+
onOpenChange: l,
|
|
36
|
+
subMenuActions: I,
|
|
37
|
+
subMenuTrigger: f,
|
|
38
|
+
viewMode: h = d.LIST
|
|
36
39
|
}) {
|
|
37
40
|
const {
|
|
38
|
-
formatMessage:
|
|
39
|
-
} =
|
|
40
|
-
label:
|
|
41
|
-
icon:
|
|
42
|
-
} =
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
className:
|
|
45
|
-
children: [
|
|
41
|
+
formatMessage: B
|
|
42
|
+
} = s(), {
|
|
43
|
+
label: $,
|
|
44
|
+
icon: k
|
|
45
|
+
} = f || {};
|
|
46
|
+
return /* @__PURE__ */ m("div", {
|
|
47
|
+
className: S.tableActionBar,
|
|
48
|
+
children: [h === d.LIST && (n == null ? void 0 : n.map(({
|
|
46
49
|
onClick: a,
|
|
47
|
-
label:
|
|
48
|
-
icon:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
label: u,
|
|
51
|
+
icon: M,
|
|
52
|
+
isDisabled: c
|
|
53
|
+
}) => /* @__PURE__ */ r(C, {
|
|
54
|
+
"aria-label": u,
|
|
55
|
+
disabled: (c == null ? void 0 : c(o)) ?? !1,
|
|
56
|
+
icon: M,
|
|
57
|
+
onClick: () => a(o),
|
|
53
58
|
size: "large"
|
|
54
|
-
}, `${
|
|
55
|
-
onOpenChange:
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
children:
|
|
58
|
-
"aria-label":
|
|
59
|
-
disabled:
|
|
60
|
-
icon:
|
|
59
|
+
}, `${o.id}-${u}`))), e ? /* @__PURE__ */ m(t.Root, {
|
|
60
|
+
onOpenChange: l,
|
|
61
|
+
children: [/* @__PURE__ */ r(t.Trigger, {
|
|
62
|
+
children: h === d.LIST ? /* @__PURE__ */ r(C, {
|
|
63
|
+
"aria-label": B(L.actionMenu),
|
|
64
|
+
disabled: p,
|
|
65
|
+
icon: b,
|
|
61
66
|
size: "large"
|
|
62
|
-
}) : /* @__PURE__ */
|
|
63
|
-
"aria-label":
|
|
64
|
-
disabled:
|
|
65
|
-
icon:
|
|
67
|
+
}) : /* @__PURE__ */ r(_.ActionIconButton, {
|
|
68
|
+
"aria-label": B(L.actionMenu),
|
|
69
|
+
disabled: p,
|
|
70
|
+
icon: b
|
|
66
71
|
})
|
|
67
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ m(t.Content, {
|
|
68
73
|
align: "start",
|
|
69
|
-
children: [
|
|
70
|
-
item:
|
|
74
|
+
children: [e.map((a) => /* @__PURE__ */ r(T, {
|
|
75
|
+
item: o,
|
|
71
76
|
...a
|
|
72
|
-
}, a.label)),
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
-
children: [
|
|
75
|
-
className:
|
|
76
|
-
}),
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
-
children:
|
|
79
|
-
item:
|
|
77
|
+
}, a.label)), I && f && /* @__PURE__ */ m(t.SubMenuRoot, {
|
|
78
|
+
children: [/* @__PURE__ */ m(t.SubMenuTrigger, {
|
|
79
|
+
children: [k && /* @__PURE__ */ r(k, {
|
|
80
|
+
className: S.actionItemIcon
|
|
81
|
+
}), $]
|
|
82
|
+
}), /* @__PURE__ */ r(t.SubMenuContent, {
|
|
83
|
+
children: I.map((a) => /* @__PURE__ */ r(T, {
|
|
84
|
+
item: o,
|
|
80
85
|
...a
|
|
81
86
|
}, a.label))
|
|
82
87
|
})]
|
|
83
88
|
})]
|
|
84
89
|
})]
|
|
85
|
-
}) : null,
|
|
90
|
+
}) : null, h === d.GRID && (n == null ? void 0 : n.map(({
|
|
86
91
|
onClick: a,
|
|
87
|
-
label:
|
|
88
|
-
icon:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
label: u,
|
|
93
|
+
icon: M,
|
|
94
|
+
isDisabled: c
|
|
95
|
+
}) => /* @__PURE__ */ r(_.ActionIconButton, {
|
|
96
|
+
"aria-label": u,
|
|
97
|
+
disabled: (c == null ? void 0 : c(o)) ?? !1,
|
|
98
|
+
icon: M,
|
|
99
|
+
onClick: () => a(o)
|
|
100
|
+
}, `${o.id}-${u}`)))]
|
|
94
101
|
});
|
|
95
102
|
}
|
|
96
103
|
export {
|
|
97
|
-
|
|
104
|
+
E as ItemActionMenu
|
|
98
105
|
};
|