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