@box/metadata-view 0.10.0 → 0.11.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.
@@ -0,0 +1,4 @@
1
+ import { ItemActionMenu as t } from "./item-action-menu.js";
2
+ export {
3
+ t as ItemActionMenu
4
+ };
@@ -1,78 +1,84 @@
1
- import { useIntl as p } from "react-intl";
2
- import { DropdownMenu as t, IconButton as h } from "@box/blueprint-web";
3
- import { Ellipsis as f } from "@box/blueprint-web-assets/icons/Fill";
4
- import g from "./messages.js";
5
- import { jsx as n, jsxs as o } from "react/jsx-runtime";
6
- import '../../../../styles/item-action-menu.css';const M = "_tableActionBar_akgtp_1", _ = "_actionItemIcon_akgtp_6", s = {
7
- tableActionBar: M,
8
- actionItemIcon: _
1
+ import { useIntl as M } from "react-intl";
2
+ import { IconButton as p, DropdownMenu as t } from "@box/blueprint-web";
3
+ import { Ellipsis as _ } from "@box/blueprint-web-assets/icons/Fill";
4
+ import k from "./messages.js";
5
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
6
+ import '../../../../styles/item-action-menu.css';const B = "_tableActionBar_akgtp_1", C = "_actionItemIcon_akgtp_6", m = {
7
+ tableActionBar: B,
8
+ actionItemIcon: C
9
9
  };
10
- function I({
11
- item: i,
12
- label: c,
13
- onClick: r,
14
- icon: l
10
+ function b({
11
+ item: c,
12
+ label: o,
13
+ onClick: l,
14
+ icon: r
15
15
  }) {
16
- const a = () => {
17
- r(i);
16
+ const i = () => {
17
+ l(c);
18
18
  };
19
- return /* @__PURE__ */ o(t.Item, {
20
- onClick: a,
21
- children: [/* @__PURE__ */ n(l, {
22
- className: s.actionItemIcon
23
- }), c]
24
- }, c);
19
+ return /* @__PURE__ */ a(t.Item, {
20
+ onClick: i,
21
+ children: [/* @__PURE__ */ e(r, {
22
+ className: m.actionItemIcon
23
+ }), o]
24
+ }, o);
25
25
  }
26
- function x({
27
- actions: i,
28
- isDisabled: c,
26
+ function R({
27
+ actions: c,
28
+ inlineActions: o,
29
+ isDisabled: l,
29
30
  item: r,
30
- onOpenChange: l,
31
- subMenuActions: a,
32
- subMenuTrigger: m
31
+ onOpenChange: i,
32
+ subMenuActions: s,
33
+ subMenuTrigger: u
33
34
  }) {
34
35
  const {
35
- formatMessage: d
36
- } = p(), {
37
- label: b,
38
- icon: u
39
- } = m || {};
40
- return /* @__PURE__ */ n("div", {
41
- className: s.tableActionBar,
42
- children: /* @__PURE__ */ o(t.Root, {
43
- onOpenChange: l,
44
- children: [/* @__PURE__ */ n(t.Trigger, {
45
- children: /* @__PURE__ */ n(h, {
46
- "aria-label": d(g.actionMenu),
47
- disabled: c,
48
- icon: f,
36
+ formatMessage: g
37
+ } = M(), {
38
+ label: h,
39
+ icon: I
40
+ } = u || {};
41
+ return /* @__PURE__ */ a("div", {
42
+ className: m.tableActionBar,
43
+ children: [o == null ? void 0 : o.map(({
44
+ onClick: n,
45
+ label: d,
46
+ icon: f
47
+ }) => /* @__PURE__ */ e(p, {
48
+ "aria-label": d,
49
+ icon: f,
50
+ onClick: () => n(r),
51
+ size: "large"
52
+ }, `${r.id}-${d}`)), c ? /* @__PURE__ */ a(t.Root, {
53
+ onOpenChange: i,
54
+ children: [/* @__PURE__ */ e(t.Trigger, {
55
+ children: /* @__PURE__ */ e(p, {
56
+ "aria-label": g(k.actionMenu),
57
+ disabled: l,
58
+ icon: _,
49
59
  size: "large"
50
60
  })
51
- }), /* @__PURE__ */ o(t.Content, {
61
+ }), /* @__PURE__ */ a(t.Content, {
52
62
  align: "start",
53
- children: [i.map(({
54
- ...e
55
- }) => /* @__PURE__ */ n(I, {
63
+ children: [c.map((n) => /* @__PURE__ */ e(b, {
56
64
  item: r,
57
- ...e
58
- }, e.label)), a && m && /* @__PURE__ */ o(t.SubMenuRoot, {
59
- children: [/* @__PURE__ */ o(t.SubMenuTrigger, {
60
- children: [u && /* @__PURE__ */ n(u, {
61
- className: s.actionItemIcon
62
- }), b]
63
- }), /* @__PURE__ */ n(t.SubMenuContent, {
64
- children: a.map(({
65
- ...e
66
- }) => /* @__PURE__ */ n(I, {
65
+ ...n
66
+ }, n.label)), s && u && /* @__PURE__ */ a(t.SubMenuRoot, {
67
+ children: [/* @__PURE__ */ a(t.SubMenuTrigger, {
68
+ children: [I && /* @__PURE__ */ e(I, {
69
+ className: m.actionItemIcon
70
+ }), h]
71
+ }), /* @__PURE__ */ e(t.SubMenuContent, {
72
+ children: s.map((n) => /* @__PURE__ */ e(b, {
67
73
  item: r,
68
- ...e
69
- }, e.label))
74
+ ...n
75
+ }, n.label))
70
76
  })]
71
77
  })]
72
78
  })]
73
- })
79
+ }) : null]
74
80
  });
75
81
  }
76
82
  export {
77
- x as ItemActionMenu
83
+ R as ItemActionMenu
78
84
  };
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./metadata-table.js";
2
+ export {
3
+ o as default
4
+ };
@@ -1,26 +1,25 @@
1
- import { TableBody as i, Row as h, Cell as d, Ghost as m } from "@box/blueprint-web";
2
- import { Size5 as n } from "@box/blueprint-web-assets/tokens/tokens";
3
- import { jsx as t } from "react/jsx-runtime";
1
+ import { TableBody as a, Row as h, Cell as n, Ghost as m } from "@box/blueprint-web";
2
+ import { Size5 as d } from "@box/blueprint-web-assets/tokens/tokens";
3
+ import { jsx as r } from "react/jsx-runtime";
4
4
  const s = 20, g = ({
5
5
  columnLength: o,
6
- rowLength: a = s
7
- }) => /* @__PURE__ */ t(i, {
6
+ rowLength: l = s
7
+ }) => /* @__PURE__ */ r(a, {
8
8
  items: Array.from({
9
- length: a
10
- }, (e, r) => ({
11
- key: r
9
+ length: l
10
+ }, (e, t) => ({
11
+ key: t
12
12
  })),
13
- children: (e) => /* @__PURE__ */ t(h, {
14
- "data-testid": "metadata-table-ghost-row",
13
+ children: (e) => /* @__PURE__ */ r(h, {
15
14
  children: Array.from({
16
15
  length: o
17
- }, (r, l) => /* @__PURE__ */ t(d, {
18
- children: /* @__PURE__ */ t(m, {
19
- height: n,
16
+ }, (t, i) => /* @__PURE__ */ r(n, {
17
+ children: /* @__PURE__ */ r(m, {
18
+ height: d,
20
19
  variant: "rectangle",
21
20
  width: "100%"
22
21
  })
23
- }, l))
22
+ }, i))
24
23
  }, e.key)
25
24
  });
26
25
  export {
@@ -1,19 +1,19 @@
1
1
  import r from "./components/filter-row/filter-row.js";
2
- import e from "./components/metadata-table/metadata-table.js";
3
- import i from "./components/pagination/pagination.js";
4
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import e from "./components/pagination/pagination.js";
3
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
4
+ import m from "./components/metadata-table/metadata-table.js";
5
5
  import '../../styles/metadata-view.css';const n = {};
6
6
  function d({
7
7
  filterRowProps: a,
8
8
  metadataTableProps: o
9
9
  }) {
10
- return /* @__PURE__ */ m("div", {
10
+ return /* @__PURE__ */ i("div", {
11
11
  className: n.container,
12
12
  children: [/* @__PURE__ */ t(r, {
13
13
  ...a
14
- }), /* @__PURE__ */ t(e, {
14
+ }), /* @__PURE__ */ t(m, {
15
15
  ...o
16
- }), /* @__PURE__ */ t(i, {})]
16
+ }), /* @__PURE__ */ t(e, {})]
17
17
  });
18
18
  }
19
19
  export {
@@ -0,0 +1 @@
1
+ export * from './item-action-menu';
@@ -6,7 +6,8 @@ export interface ItemAction {
6
6
  icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>>;
7
7
  }
8
8
  export interface ItemActionMenuProps {
9
- actions: ItemAction[];
9
+ actions?: ItemAction[];
10
+ inlineActions?: ItemAction[];
10
11
  isDisabled?: boolean;
11
12
  item: Item;
12
13
  onOpenChange: (open: boolean) => void;
@@ -16,4 +17,4 @@ export interface ItemActionMenuProps {
16
17
  icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>>;
17
18
  };
18
19
  }
19
- export declare function ItemActionMenu({ actions, isDisabled, item, onOpenChange, subMenuActions, subMenuTrigger, }: ItemActionMenuProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function ItemActionMenu({ actions, inlineActions, isDisabled, item, onOpenChange, subMenuActions, subMenuTrigger, }: ItemActionMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './metadata-table';
2
+ export { default } from './metadata-table';
@@ -1,6 +1,6 @@
1
1
  import { TableProps } from '@box/blueprint-web';
2
2
  import { Item } from '@box/types';
3
- import { ItemActionMenuProps } from '../item-action-menu/item-action-menu';
3
+ import { ItemActionMenuProps } from '../item-action-menu';
4
4
  import { Column } from '../../types';
5
5
  export interface MetadataTableProps extends TableProps {
6
6
  columns: Column[];
@@ -1,11 +1,4 @@
1
- import { Item } from '@box/types';
2
- import { Column } from '../../../types';
3
- import { ItemActionMenuProps } from '../../item-action-menu/item-action-menu';
4
- export interface BodyProps {
5
- columns: Column[];
6
- isSelectAllEnabled: boolean;
7
- items: Item[];
8
- itemActionMenuProps?: Omit<ItemActionMenuProps, 'item' | 'onOpenChange'>;
9
- }
10
- declare const TableBodyWithData: ({ columns, isSelectAllEnabled, items, itemActionMenuProps }: BodyProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { TableProps } from '@box/blueprint-web';
2
+ import { MetadataTableProps } from '../metadata-table';
3
+ declare const TableBodyWithData: ({ columns, isSelectAllEnabled, items, itemActionMenuProps, }: Omit<MetadataTableProps, keyof TableProps>) => import("react/jsx-runtime").JSX.Element;
11
4
  export default TableBodyWithData;
@@ -1,4 +1,4 @@
1
- import { MetadataTableProps } from './components/metadata-table/metadata-table';
1
+ import { MetadataTableProps } from './components/metadata-table';
2
2
  import { FilterRowProps } from './components/filter-row/types';
3
3
  export interface MetadataViewProps {
4
4
  filterRowProps: FilterRowProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^11.12.0",