@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 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";
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 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
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 T({
13
- item: e,
14
- label: n,
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: o,
21
+ icon: r,
17
22
  isDisabled: l
18
23
  }) {
19
- const I = () => {
20
- p(e);
21
- }, f = i(() => (l == null ? void 0 : l(e)) ?? !1, [l, e]);
22
- return /* @__PURE__ */ m(t.Item, {
23
- disabled: f,
24
- onClick: I,
25
- children: [/* @__PURE__ */ r(o, {
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
- }), n]
28
- }, n);
32
+ }), o]
33
+ }, o);
29
34
  }
30
- function E({
31
- actions: e,
32
- inlineActions: n,
35
+ function P({
36
+ actions: t,
37
+ inlineActions: o,
33
38
  isDisabled: p,
34
- item: o,
39
+ item: r,
35
40
  onOpenChange: l,
36
- subMenuActions: I,
37
- subMenuTrigger: f,
41
+ subMenuActions: f,
42
+ subMenuTrigger: I,
38
43
  viewMode: h = d.LIST
39
44
  }) {
40
45
  const {
41
- formatMessage: B
42
- } = s(), {
43
- label: $,
44
- icon: k
45
- } = f || {};
46
- return /* @__PURE__ */ m("div", {
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 && (n == null ? void 0 : n.map(({
53
+ children: [h === d.LIST && (o == null ? void 0 : o.map(({
49
54
  onClick: a,
50
- label: u,
55
+ label: m,
51
56
  icon: M,
52
57
  isDisabled: c
53
- }) => /* @__PURE__ */ r(C, {
54
- "aria-label": u,
55
- disabled: (c == null ? void 0 : c(o)) ?? !1,
58
+ }) => /* @__PURE__ */ n(C, {
59
+ "aria-label": m,
60
+ disabled: (c == null ? void 0 : c(r)) ?? !1,
56
61
  icon: M,
57
- onClick: () => a(o),
62
+ onClick: s(() => a(r)),
58
63
  size: "large"
59
- }, `${o.id}-${u}`))), e ? /* @__PURE__ */ m(t.Root, {
64
+ }, `${r.id}-${m}`))), t ? /* @__PURE__ */ u(e.Root, {
60
65
  onOpenChange: l,
61
- children: [/* @__PURE__ */ r(t.Trigger, {
62
- children: h === d.LIST ? /* @__PURE__ */ r(C, {
63
- "aria-label": B(L.actionMenu),
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: b,
70
+ icon: _,
66
71
  size: "large"
67
- }) : /* @__PURE__ */ r(_.ActionIconButton, {
68
- "aria-label": B(L.actionMenu),
72
+ }) : /* @__PURE__ */ n(i.ActionIconButton, {
73
+ "aria-label": k(b.actionMenu),
69
74
  disabled: p,
70
- icon: b
75
+ icon: _
71
76
  })
72
- }), /* @__PURE__ */ m(t.Content, {
77
+ }), /* @__PURE__ */ u(e.Content, {
73
78
  align: "start",
74
- children: [e.map((a) => /* @__PURE__ */ r(T, {
75
- item: o,
79
+ children: [t.map((a) => /* @__PURE__ */ n(L, {
80
+ item: r,
76
81
  ...a
77
- }, a.label)), I && f && /* @__PURE__ */ m(t.SubMenuRoot, {
78
- children: [/* @__PURE__ */ m(t.SubMenuTrigger, {
79
- children: [k && /* @__PURE__ */ r(k, {
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__ */ r(t.SubMenuContent, {
83
- children: I.map((a) => /* @__PURE__ */ r(T, {
84
- item: o,
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 && (n == null ? void 0 : n.map(({
95
+ }) : null, h === d.GRID && (o == null ? void 0 : o.map(({
91
96
  onClick: a,
92
- label: u,
97
+ label: m,
93
98
  icon: M,
94
99
  isDisabled: c
95
- }) => /* @__PURE__ */ r(_.ActionIconButton, {
96
- "aria-label": u,
97
- disabled: (c == null ? void 0 : c(o)) ?? !1,
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(o)
100
- }, `${o.id}-${u}`)))]
104
+ onClick: () => a(r)
105
+ }, `${r.id}-${m}`)))]
101
106
  });
102
107
  }
103
108
  export {
104
- E as ItemActionMenu
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.4",
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.84.0",
21
+ "@box/blueprint-web": "^12.85.0",
22
22
  "@box/blueprint-web-assets": "^4.72.0",
23
- "@box/box-item-type-selector": "^1.0.1",
23
+ "@box/box-item-type-selector": "^1.0.2",
24
24
  "@box/eslint-plugin-blueprint": "1.0.5",
25
- "@box/item-icon": "^1.1.3",
26
- "@box/metadata-filter": "^1.37.3",
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",