@box/metadata-view 0.34.0 → 0.35.1

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,87 +1,87 @@
1
- import { Row as S, Cell as c, Text as s, ActionCell as H } from "@box/blueprint-web";
1
+ import { Row as H, Cell as a, Text as s, ActionCell as L } from "@box/blueprint-web";
2
2
  import b from "lodash/get";
3
- import { ItemTypeIcon as m } from "@box/item-icon";
4
- import L from "clsx";
3
+ import { ItemTypeIcon as p } from "@box/item-icon";
4
+ import A from "clsx";
5
5
  import { I as n } from "./types.js";
6
- import { THUMBNAIL_LIST_VIEW_HEIGHTS as A } from "../esm/lib/components/constants.js";
6
+ import { THUMBNAIL_LIST_VIEW_HEIGHTS as x } from "../esm/lib/components/constants.js";
7
7
  import { jsxs as _, jsx as e } from "react/jsx-runtime";
8
- import { ItemActionMenu as x } from "../esm/lib/components/item-action-menu/item-action-menu.js";
9
- import '../styles/table-row.css';const E = "_tableHeaderActionsWrapper_uw3hc_1", y = "_tableHeaderActions_uw3hc_1", R = "_tableRow_uw3hc_33", g = "_selectAllCheckbox_uw3hc_42", U = "_tableNameCell_uw3hc_47", k = "_tableNameCellSubTitle_uw3hc_53", B = "_infiniteScrollTableContainerFullHeight_uw3hc_58", W = "_iconCell_uw3hc_64", i = {
10
- tableHeaderActionsWrapper: E,
11
- tableHeaderActions: y,
12
- tableRow: R,
13
- selectAllCheckbox: g,
14
- tableNameCell: U,
15
- tableNameCellSubTitle: k,
16
- infiniteScrollTableContainerFullHeight: B,
17
- iconCell: W
18
- }, q = ({
8
+ import { ItemActionMenu as E } from "../esm/lib/components/item-action-menu/item-action-menu.js";
9
+ import '../styles/table-row.css';const q = "_tableHeaderActionsWrapper_zlqta_1", z = "_tableHeaderActions_zlqta_1", y = "_tableRow_zlqta_33", R = "_selectAllCheckbox_zlqta_42", g = "_tableNameCell_zlqta_47", w = "_tableNameCellSubtitle_zlqta_53", U = "_infiniteScrollTableContainerFullHeight_zlqta_58", k = "_iconCell_zlqta_64", i = {
10
+ tableHeaderActionsWrapper: q,
11
+ tableHeaderActions: z,
12
+ tableRow: y,
13
+ selectAllCheckbox: R,
14
+ tableNameCell: g,
15
+ tableNameCellSubtitle: w,
16
+ infiniteScrollTableContainerFullHeight: U,
17
+ iconCell: k
18
+ }, G = ({
19
19
  item: l,
20
- columns: N,
20
+ columns: h,
21
21
  iconColumnVariant: t,
22
- isSelectAllEnabled: p,
22
+ isSelectAllEnabled: I,
23
23
  itemActionMenuProps: d,
24
- zoomLevel: I = 0
24
+ zoomLevel: u = 0
25
25
  }) => {
26
- const T = I;
27
- return /* @__PURE__ */ _(S, {
26
+ const C = u;
27
+ return /* @__PURE__ */ _(H, {
28
28
  className: i.tableRow,
29
29
  id: l.id,
30
- children: [t === n.COLUMN ? /* @__PURE__ */ e(c, {
30
+ children: [t === n.COLUMN ? /* @__PURE__ */ e(a, {
31
31
  style: {
32
- height: A[T]
32
+ height: x[C]
33
33
  },
34
- children: /* @__PURE__ */ e(m, {
34
+ children: /* @__PURE__ */ e(p, {
35
35
  className: i.iconCell,
36
36
  item: l
37
37
  })
38
- }, `item-type-icon-${l.id}`) : null, N.map((o) => {
38
+ }, `item-type-icon-${l.id}`) : null, h.map((o) => {
39
39
  const {
40
- cellRenderer: h,
41
- id: a,
42
- subTitle: C,
40
+ cellRenderer: m,
41
+ id: r,
42
+ subtitle: T,
43
43
  textValue: f,
44
- type: w
45
- } = o, r = `${f}-${l.id}`;
46
- if (a === "name" && (t === n.INLINE || t === n.INLINE_SUBTITLE))
47
- return /* @__PURE__ */ e(c, {
44
+ type: S
45
+ } = o, c = `${f}-${l.id}`;
46
+ if (r === "name" && (t === n.INLINE || t === n.INLINE_SUBTITLE))
47
+ return /* @__PURE__ */ e(a, {
48
48
  children: /* @__PURE__ */ _("div", {
49
49
  className: i.tableNameCell,
50
- children: [/* @__PURE__ */ e(m, {
50
+ children: [/* @__PURE__ */ e(p, {
51
51
  item: l
52
52
  }), /* @__PURE__ */ _("div", {
53
- className: L({
54
- [i.tableNameCellSubTitle]: t === n.INLINE_SUBTITLE
53
+ className: A({
54
+ [i.tableNameCellSubtitle]: t === n.INLINE_SUBTITLE
55
55
  }),
56
56
  children: [/* @__PURE__ */ e(s, {
57
57
  as: "span",
58
- children: b(l, a)
58
+ children: b(l, r)
59
59
  }), t === n.INLINE_SUBTITLE ? /* @__PURE__ */ e(s, {
60
60
  as: "span",
61
61
  color: "textOnLightSecondary",
62
- children: C
62
+ children: T
63
63
  }) : null]
64
64
  })]
65
65
  })
66
- }, r);
67
- if (h)
68
- return /* @__PURE__ */ e(c, {
69
- children: h(l, o)
70
- }, r);
71
- if (w === "multiSelect") {
72
- const u = b(l, a);
73
- return /* @__PURE__ */ e(c, {
74
- children: u ? u.join(" ") : ""
75
- }, r);
66
+ }, c);
67
+ if (m)
68
+ return /* @__PURE__ */ e(a, {
69
+ children: m(l, o)
70
+ }, c);
71
+ if (S === "multiSelect") {
72
+ const N = b(l, r);
73
+ return /* @__PURE__ */ e(a, {
74
+ children: N ? N.join(" ") : ""
75
+ }, c);
76
76
  }
77
- return /* @__PURE__ */ e(c, {
77
+ return /* @__PURE__ */ e(a, {
78
78
  children: /* @__PURE__ */ e(s, {
79
79
  as: "span",
80
- children: b(l, a)
80
+ children: b(l, r)
81
81
  })
82
- }, r);
83
- }), p && /* @__PURE__ */ e(H, {
84
- children: (o) => d ? /* @__PURE__ */ e(x, {
82
+ }, c);
83
+ }), I && /* @__PURE__ */ e(L, {
84
+ children: (o) => d ? /* @__PURE__ */ e(E, {
85
85
  ...d,
86
86
  item: l,
87
87
  onOpenChange: o
@@ -90,6 +90,6 @@ import '../styles/table-row.css';const E = "_tableHeaderActionsWrapper_uw3hc_1",
90
90
  }, l.id);
91
91
  };
92
92
  export {
93
- q as T,
93
+ G as T,
94
94
  i as s
95
95
  };
@@ -1,14 +1,14 @@
1
- import { Text as D, ListCheckbox as _, TableHeader as v, Column as M } from "@box/blueprint-web";
2
- import { useRef as E } from "react";
3
- import { useIntl as S } from "react-intl";
4
- import { useInfiniteScrollTableItems as k } from "./hooks/useInfiniteScrollTableItems.js";
1
+ import { useRef as v } from "react";
2
+ import { useIntl as M } from "react-intl";
3
+ import { Text as E, ListCheckbox as S, TableHeader as k, Column as B } from "@box/blueprint-web";
4
+ import { useInfiniteScrollTableItems as O } from "./hooks/useInfiniteScrollTableItems.js";
5
5
  import T from "./table-renderer.js";
6
- import { I as B } from "../../../../chunks/types.js";
7
- import { THUMBNAIL_WIDTHS as O } from "../constants.js";
6
+ import { I as P } from "../../../../chunks/types.js";
7
+ import { THUMBNAIL_WIDTHS as U } from "../constants.js";
8
8
  import { s } from "../../../../chunks/table-row.js";
9
- import P from "./messages.js";
9
+ import j from "./messages.js";
10
10
  import { jsx as e } from "react/jsx-runtime";
11
- const U = 40, K = ({
11
+ const F = 40, Q = ({
12
12
  columns: o,
13
13
  isLoading: l = !1,
14
14
  iconColumnVariant: n,
@@ -17,28 +17,29 @@ const U = 40, K = ({
17
17
  itemActionMenuProps: I,
18
18
  isInfiniteScrollEnabled: R = !1,
19
19
  hasNextPage: x = !1,
20
- onGetNextPage: C,
21
- placeholderRowsCount: W,
20
+ onInlineEditChange: C,
21
+ onGetNextPage: W,
22
+ placeholderRowsCount: g,
22
23
  zoomLevel: r,
23
- ...g
24
+ ...w
24
25
  }) => {
25
26
  var u;
26
27
  const {
27
28
  formatMessage: c
28
- } = S(), f = E(null), {
29
+ } = M(), f = v(null), {
29
30
  virtualItemsToDisplay: p,
30
- getTableHeight: w
31
- } = k({
31
+ getTableHeight: y
32
+ } = O({
32
33
  items: m,
33
34
  hasNextPage: x,
34
35
  isLoading: l,
35
36
  parentRef: f,
36
- onGetNextPage: C,
37
- placeholderRowsCount: W
38
- }), a = [], y = 0;
39
- if (n === B.COLUMN) {
40
- r = r || y;
41
- const t = parseInt(O[r], 10) + 24;
37
+ onGetNextPage: W,
38
+ placeholderRowsCount: g
39
+ }), a = [], A = 0;
40
+ if (n === P.COLUMN) {
41
+ r = r || A;
42
+ const t = parseInt(U[r], 10) + 24;
42
43
  a.push({
43
44
  id: "item-type-icon",
44
45
  isRowHeader: !1,
@@ -47,31 +48,31 @@ const U = 40, K = ({
47
48
  maxWidth: t
48
49
  });
49
50
  }
50
- const A = o.map((t) => {
51
+ const N = o.map((t) => {
51
52
  const {
52
53
  id: H,
53
54
  headerRenderer: b,
54
55
  textValue: i,
55
- ...N
56
+ ..._
56
57
  } = t;
57
58
  return {
58
- children: b ? b(i, t) : /* @__PURE__ */ e(D, {
59
+ children: b ? b(i, t) : /* @__PURE__ */ e(E, {
59
60
  as: "span",
60
61
  children: i
61
62
  }),
62
63
  isRowHeader: H === "name",
63
64
  id: H,
64
65
  textValue: i,
65
- ...N
66
+ ..._
66
67
  };
67
68
  });
68
- a.push(...A), d && a.push({
69
+ a.push(...N), d && a.push({
69
70
  id: "actions",
70
71
  className: s.tableHeaderActions,
71
72
  children: /* @__PURE__ */ e("div", {
72
73
  className: s.tableHeaderActionsWrapper,
73
- children: /* @__PURE__ */ e(_, {
74
- "aria-label": c(P.selectAll),
74
+ children: /* @__PURE__ */ e(S, {
75
+ "aria-label": c(j.selectAll),
75
76
  className: s.selectAllCheckbox,
76
77
  isDisabled: l
77
78
  })
@@ -80,22 +81,23 @@ const U = 40, K = ({
80
81
  hideHeader: !1,
81
82
  allowsSorting: !1
82
83
  });
83
- const h = {
84
- tableHeader: /* @__PURE__ */ e(v, {
85
- columns: a,
86
- children: (t) => /* @__PURE__ */ e(M, {
87
- ...t
88
- })
89
- }),
84
+ const D = /* @__PURE__ */ e(k, {
85
+ columns: a,
86
+ children: (t) => /* @__PURE__ */ e(B, {
87
+ ...t
88
+ })
89
+ }), h = {
90
+ columnCount: a.length,
90
91
  columns: o,
92
+ formatMessage: c,
91
93
  iconColumnVariant: n,
94
+ isLoading: l,
92
95
  isSelectAllEnabled: d,
93
96
  itemActionMenuProps: I,
94
97
  items: m,
95
- isLoading: l,
96
- formatMessage: c,
97
- tableProps: g,
98
- columnCount: a.length,
98
+ onInlineEditChange: C,
99
+ tableHeader: D,
100
+ tableProps: w,
99
101
  zoomLevel: r
100
102
  };
101
103
  return R ? /* @__PURE__ */ e("div", {
@@ -105,7 +107,7 @@ const U = 40, K = ({
105
107
  style: {
106
108
  position: "relative",
107
109
  width: "100%",
108
- height: w() + U
110
+ height: y() + F
109
111
  },
110
112
  children: /* @__PURE__ */ e(T, {
111
113
  ...h,
@@ -125,5 +127,5 @@ const U = 40, K = ({
125
127
  });
126
128
  };
127
129
  export {
128
- K as default
130
+ Q as default
129
131
  };
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./inline-editing-cell.js";
2
+ export {
3
+ o as default
4
+ };
@@ -0,0 +1,37 @@
1
+ import { Cell as c, DropdownMenu as l, Button as a } from "@box/blueprint-web";
2
+ import { CaretDown as g } from "@box/blueprint-web-assets/icons/Fill";
3
+ import h from "lodash/get";
4
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
5
+ import '../../../../../../styles/inline-editing-cell.css';const E = "_inlineEditingCell_1xsiq_1", p = {
6
+ inlineEditingCell: E
7
+ }, I = ({
8
+ column: n,
9
+ item: d,
10
+ onInlineEditChange: r
11
+ }) => {
12
+ const s = `${n.id}-${d.id}`, e = h(d, n.id) || "--", o = (i, f) => {
13
+ r(d, i, n.id);
14
+ };
15
+ return /* @__PURE__ */ t(c, {
16
+ children: /* @__PURE__ */ C(l.Root, {
17
+ children: [/* @__PURE__ */ t(l.Trigger, {
18
+ children: /* @__PURE__ */ t(a, {
19
+ className: p.inlineEditingCell,
20
+ icon: g,
21
+ variant: "secondary",
22
+ children: e
23
+ })
24
+ }), /* @__PURE__ */ t(l.Content, {
25
+ align: "start",
26
+ children: n.inlineEditingOptions && n.inlineEditingOptions.map((i) => /* @__PURE__ */ t(l.CheckboxItem, {
27
+ checked: e === i || (e == null ? void 0 : e.includes(i)),
28
+ onSelect: () => o(i, n.id),
29
+ children: i
30
+ }, i))
31
+ })]
32
+ })
33
+ }, s);
34
+ };
35
+ export {
36
+ I as default
37
+ };
@@ -1,182 +1,176 @@
1
- import { TableBody as y, Row as E, Cell as d, ActionCell as L, Text as p } from "@box/blueprint-web";
2
- import { ItemTypeIcon as C } from "@box/item-icon";
1
+ import { TableBody as y, Row as L, Cell as c, ActionCell as b, Text as N } from "@box/blueprint-web";
2
+ import { ItemTypeIcon as $ } from "@box/item-icon";
3
3
  import x from "clsx";
4
4
  import T from "lodash/get";
5
- import s from "react";
5
+ import i from "react";
6
6
  import { I as h } from "../../../../../chunks/types.js";
7
- import { THUMBNAIL_LIST_VIEW_HEIGHTS as b } from "../../constants.js";
8
- import g from "./ghost-row/ghost-row.js";
9
- import { s as f, T as w } from "../../../../../chunks/table-row.js";
10
- import { jsx as r, jsxs as N } from "react/jsx-runtime";
11
- import { ItemActionMenu as R } from "../../item-action-menu/item-action-menu.js";
12
- const S = /* @__PURE__ */ s.memo(({
7
+ import { THUMBNAIL_LIST_VIEW_HEIGHTS as R } from "../../constants.js";
8
+ import S from "./ghost-row/ghost-row.js";
9
+ import { s as f, T as g } from "../../../../../chunks/table-row.js";
10
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
11
+ import w from "./inline-editing-cell/inline-editing-cell.js";
12
+ import { ItemActionMenu as B } from "../../item-action-menu/item-action-menu.js";
13
+ const _ = /* @__PURE__ */ i.memo(({
13
14
  item: t,
14
15
  column: e,
15
16
  iconColumnVariant: n
16
17
  }) => {
17
18
  const {
18
- id: l,
19
- subTitle: a
20
- } = e, c = `${e.textValue}-${t.id}`;
21
- return /* @__PURE__ */ r(d, {
22
- children: /* @__PURE__ */ N("div", {
19
+ id: o,
20
+ subtitle: d
21
+ } = e, a = `${e.textValue}-${t.id}`;
22
+ return /* @__PURE__ */ r(c, {
23
+ children: /* @__PURE__ */ u("div", {
23
24
  className: f.tableNameCell,
24
- children: [/* @__PURE__ */ r(C, {
25
+ children: [/* @__PURE__ */ r($, {
25
26
  item: t
26
- }), /* @__PURE__ */ N("div", {
27
+ }), /* @__PURE__ */ u("div", {
27
28
  className: x({
28
- [f.tableNameCellSubTitle]: n === h.INLINE_SUBTITLE
29
+ [f.tableNameCellSubtitle]: n === h.INLINE_SUBTITLE
29
30
  }),
30
- children: [/* @__PURE__ */ r(p, {
31
+ children: [/* @__PURE__ */ r(N, {
31
32
  as: "span",
32
- children: T(t, l)
33
- }), n === h.INLINE_SUBTITLE && /* @__PURE__ */ r(p, {
33
+ children: T(t, o)
34
+ }), n === h.INLINE_SUBTITLE && /* @__PURE__ */ r(N, {
34
35
  as: "span",
35
36
  color: "textOnLightSecondary",
36
- children: a
37
+ children: d
37
38
  })]
38
39
  })]
39
40
  })
40
- }, c);
41
- }), k = /* @__PURE__ */ s.memo(({
41
+ }, a);
42
+ }), k = /* @__PURE__ */ i.memo(({
42
43
  item: t,
43
44
  column: e
44
45
  }) => {
45
- var l;
46
+ var o;
46
47
  const n = `${e.textValue}-${t.id}`;
47
- return /* @__PURE__ */ r(d, {
48
- children: (l = e.cellRenderer) == null ? void 0 : l.call(e, t, e)
48
+ return /* @__PURE__ */ r(c, {
49
+ children: (o = e.cellRenderer) == null ? void 0 : o.call(e, t, e)
49
50
  }, n);
50
- }), B = /* @__PURE__ */ s.memo(({
51
+ }), U = /* @__PURE__ */ i.memo(({
51
52
  item: t,
52
53
  column: e
53
54
  }) => {
54
- const n = `${e.textValue}-${t.id}`, l = T(t, e.id);
55
- return l ? /* @__PURE__ */ r(d, {
56
- children: l.join(" ")
57
- }, n) : /* @__PURE__ */ r(d, {}, n);
58
- }), _ = /* @__PURE__ */ s.memo(({
55
+ const n = `${e.textValue}-${t.id}`, o = T(t, e.id);
56
+ return o ? /* @__PURE__ */ r(c, {
57
+ children: o.join(" ")
58
+ }, n) : /* @__PURE__ */ r(c, {}, n);
59
+ }), W = /* @__PURE__ */ i.memo(({
59
60
  item: t,
60
61
  column: e
61
62
  }) => {
62
63
  const n = `${e.textValue}-${t.id}`;
63
- return /* @__PURE__ */ r(d, {
64
- children: /* @__PURE__ */ r(p, {
64
+ return /* @__PURE__ */ r(c, {
65
+ children: /* @__PURE__ */ r(N, {
65
66
  as: "span",
66
67
  children: T(t, e.id)
67
68
  })
68
69
  }, n);
69
- }), U = /* @__PURE__ */ s.memo(({
70
- item: t,
71
- column: e
72
- }) => {
73
- const n = `${e.textValue}-${t.id}`;
74
- return /* @__PURE__ */ r(d, {
75
- children: /* @__PURE__ */ N(p, {
76
- as: "span",
77
- children: [T(t, e.id), " withInlineEditing"]
78
- })
79
- }, n);
80
- }), W = /* @__PURE__ */ s.memo(({
70
+ }), j = /* @__PURE__ */ i.memo(({
81
71
  item: t,
82
72
  column: e,
83
- iconColumnVariant: n
73
+ iconColumnVariant: n,
74
+ onInlineEditChange: o
84
75
  }) => {
85
76
  const {
86
- cellRenderer: l,
77
+ cellRenderer: d,
87
78
  id: a,
88
- isInlineEditingEnabled: c,
79
+ isInlineEditingEnabled: p,
89
80
  type: I
90
81
  } = e;
91
- return a === "name" && (n === h.INLINE || n === h.INLINE_SUBTITLE) ? /* @__PURE__ */ r(S, {
82
+ return a === "name" && (n === h.INLINE || n === h.INLINE_SUBTITLE) ? /* @__PURE__ */ r(_, {
92
83
  column: e,
93
84
  iconColumnVariant: n,
94
85
  item: t
95
- }) : l ? /* @__PURE__ */ r(k, {
86
+ }) : d ? /* @__PURE__ */ r(k, {
96
87
  column: e,
97
88
  item: t
98
- }) : I === "multiSelect" ? /* @__PURE__ */ r(B, {
89
+ }) : I === "multiSelect" ? /* @__PURE__ */ r(U, {
99
90
  column: e,
100
91
  item: t
101
- }) : c && I === "enum" ? /* @__PURE__ */ r(U, {
92
+ }) : p && I === "enum" ? /* @__PURE__ */ r(w, {
102
93
  column: e,
103
- item: t
104
- }) : /* @__PURE__ */ r(_, {
94
+ item: t,
95
+ onInlineEditChange: o
96
+ }) : /* @__PURE__ */ r(W, {
105
97
  column: e,
106
98
  item: t
107
99
  });
108
- }), j = /* @__PURE__ */ s.memo(({
100
+ }), D = /* @__PURE__ */ i.memo(({
109
101
  item: t,
110
102
  zoomLevel: e
111
- }) => /* @__PURE__ */ r(d, {
103
+ }) => /* @__PURE__ */ r(c, {
112
104
  style: {
113
- height: b[e]
105
+ height: R[e]
114
106
  },
115
- children: /* @__PURE__ */ r(C, {
107
+ children: /* @__PURE__ */ r($, {
116
108
  className: f.iconCell,
117
109
  item: t
118
110
  })
119
- }, `item-type-icon-${t.id}`)), D = /* @__PURE__ */ s.memo(({
111
+ }, `item-type-icon-${t.id}`)), G = /* @__PURE__ */ i.memo(({
120
112
  item: t,
121
113
  itemActionMenuProps: e
122
- }) => /* @__PURE__ */ r(L, {
123
- children: (n) => e ? /* @__PURE__ */ r(R, {
114
+ }) => /* @__PURE__ */ r(b, {
115
+ children: (n) => e ? /* @__PURE__ */ r(B, {
124
116
  ...e,
125
117
  item: t,
126
118
  onOpenChange: n
127
119
  }) : null
128
- })), Q = ({
120
+ })), Y = ({
129
121
  columns: t,
130
122
  iconColumnVariant: e,
131
123
  isSelectAllEnabled: n,
132
- items: l,
133
- itemActionMenuProps: a,
134
- virtualItems: c,
135
- columnCount: I,
136
- zoomLevel: u
124
+ items: o,
125
+ itemActionMenuProps: d,
126
+ virtualItems: a,
127
+ columnCount: p,
128
+ zoomLevel: I,
129
+ onInlineEditChange: C
137
130
  }) => {
138
- const $ = e === h.COLUMN;
139
- if (c) {
140
- const o = (i) => /* @__PURE__ */ r(g, {
141
- columnLength: I || 0,
142
- rowKey: `ghost-${i}`
143
- }), m = (i) => /* @__PURE__ */ r(w, {
131
+ const E = e === h.COLUMN;
132
+ if (a) {
133
+ const l = (s) => /* @__PURE__ */ r(S, {
134
+ columnLength: p || 0,
135
+ rowKey: `ghost-${s}`
136
+ }), m = (s) => /* @__PURE__ */ r(g, {
144
137
  columns: t,
145
138
  iconColumnVariant: e,
146
139
  isSelectAllEnabled: n,
147
- item: i,
148
- itemActionMenuProps: a,
149
- zoomLevel: u
140
+ item: s,
141
+ itemActionMenuProps: d,
142
+ zoomLevel: I
150
143
  });
151
144
  return /* @__PURE__ */ r(y, {
152
- items: c,
145
+ items: a,
153
146
  children: ({
154
- index: i
155
- }) => i >= l.length ? o(i) : m(l[i])
147
+ index: s
148
+ }) => s >= o.length ? l(s) : m(o[s])
156
149
  });
157
150
  }
158
151
  return /* @__PURE__ */ r(y, {
159
- items: l.map((o) => ({
160
- key: o.id,
161
- ...o
152
+ items: o.map((l) => ({
153
+ key: l.id,
154
+ ...l
162
155
  })),
163
- children: (o) => /* @__PURE__ */ N(E, {
156
+ children: (l) => /* @__PURE__ */ u(L, {
164
157
  className: f.tableRow,
165
- id: o.id,
166
- children: [$ && /* @__PURE__ */ r(j, {
167
- item: o,
168
- zoomLevel: u
169
- }), t.map((m) => /* @__PURE__ */ r(W, {
158
+ id: l.id,
159
+ children: [E && /* @__PURE__ */ r(D, {
160
+ item: l,
161
+ zoomLevel: I
162
+ }), t.map((m) => /* @__PURE__ */ r(j, {
170
163
  column: m,
171
164
  iconColumnVariant: e,
172
- item: o
173
- }, `${m.textValue}-${o.id}`)), n && /* @__PURE__ */ r(D, {
174
- item: o,
175
- itemActionMenuProps: a
165
+ item: l,
166
+ onInlineEditChange: C
167
+ }, `${m.textValue}-${l.id}`)), n && /* @__PURE__ */ r(G, {
168
+ item: l,
169
+ itemActionMenuProps: d
176
170
  })]
177
- }, o.id)
171
+ }, l.id)
178
172
  });
179
173
  };
180
174
  export {
181
- Q as default
175
+ Y as default
182
176
  };
@@ -1,10 +1,10 @@
1
- import { Table as b } from "@box/blueprint-web";
2
- import T from "./table-body/ghost-table-body.js";
3
- import d from "./table-body/table-body-with-data.js";
4
- import { I as x } from "../../../../chunks/types.js";
5
- import B from "./messages.js";
6
- import { jsxs as j, jsx as i } from "react/jsx-runtime";
7
- const N = ({
1
+ import { Table as T } from "@box/blueprint-web";
2
+ import d from "./table-body/ghost-table-body.js";
3
+ import x from "./table-body/table-body-with-data.js";
4
+ import { I as B } from "../../../../chunks/types.js";
5
+ import j from "./messages.js";
6
+ import { jsxs as y, jsx as i } from "react/jsx-runtime";
7
+ const O = ({
8
8
  tableHeader: s,
9
9
  columns: t,
10
10
  iconColumnVariant: n,
@@ -17,21 +17,22 @@ const N = ({
17
17
  virtualItems: o,
18
18
  style: h,
19
19
  columnCount: p,
20
- zoomLevel: C
20
+ zoomLevel: C,
21
+ onInlineEditChange: g
21
22
  }) => {
22
23
  const m = p || (() => {
23
24
  let e = t.length;
24
- return n === x.COLUMN && (e += 1), r && (e += 1), e;
25
- })(), g = l && !(o != null && o.length);
26
- return /* @__PURE__ */ j(b, {
27
- "aria-label": u(B.listView),
25
+ return n === B.COLUMN && (e += 1), r && (e += 1), e;
26
+ })(), b = l && !(o != null && o.length);
27
+ return /* @__PURE__ */ y(T, {
28
+ "aria-label": u(j.listView),
28
29
  selectionBehavior: "toggle",
29
30
  selectionMode: "multiple",
30
31
  style: h,
31
32
  ...a,
32
- children: [s, g ? /* @__PURE__ */ i(T, {
33
+ children: [s, b ? /* @__PURE__ */ i(d, {
33
34
  columnLength: m
34
- }) : /* @__PURE__ */ i(d, {
35
+ }) : /* @__PURE__ */ i(x, {
35
36
  columnCount: m,
36
37
  columns: t,
37
38
  iconColumnVariant: n,
@@ -39,11 +40,12 @@ const N = ({
39
40
  isSelectAllEnabled: r,
40
41
  itemActionMenuProps: c,
41
42
  items: f,
43
+ onInlineEditChange: g,
42
44
  virtualItems: o,
43
45
  zoomLevel: C
44
46
  })]
45
47
  });
46
48
  };
47
49
  export {
48
- N as default
50
+ O as default
49
51
  };
@@ -0,0 +1 @@
1
+ ._inlineEditingCell_1xsiq_1._inlineEditingCell_1xsiq_1._inlineEditingCell_1xsiq_1{display:inline-flex;gap:var(--space-2);align-items:center;padding:var(--space-1);font-weight:var(--font-weights-regular);background-color:transparent;border:transparent}._inlineEditingCell_1xsiq_1._inlineEditingCell_1xsiq_1._inlineEditingCell_1xsiq_1:hover{background-color:transparent;border:transparent}
@@ -1 +1 @@
1
- ._tableHeaderActionsWrapper_uw3hc_1{position:absolute;top:0;right:var(--size-4);bottom:0;display:flex;gap:var(--space-2);align-items:center;justify-content:center;padding:0 var(--space-2);background:var(--item-background);margin-block:var(--space-2)}._tableHeaderActionsWrapper_uw3hc_1:before{position:absolute;left:0;z-index:0;display:block;width:0;height:50%;box-shadow:-.25rem 0 .625rem .625rem var(--item-background);content:""}._tableHeaderActions_uw3hc_1{position:sticky;right:0;width:var(--size-6);padding:0}._tableRow_uw3hc_33:after{height:100%!important}._tableRow_uw3hc_33[aria-selected=true]:after{height:100%!important}._selectAllCheckbox_uw3hc_42 svg{transform:none!important}._tableNameCell_uw3hc_47{display:flex;gap:var(--space-3);align-items:center}._tableNameCellSubTitle_uw3hc_53{display:flex;flex-direction:column}._infiniteScrollTableContainerFullHeight_uw3hc_58{width:100%;height:100%;overflow:auto}._iconCell_uw3hc_64{width:100%!important;height:100%!important}
1
+ ._tableHeaderActionsWrapper_zlqta_1{position:absolute;top:0;right:var(--size-4);bottom:0;display:flex;gap:var(--space-2);align-items:center;justify-content:center;padding:0 var(--space-2);background:var(--item-background);margin-block:var(--space-2)}._tableHeaderActionsWrapper_zlqta_1:before{position:absolute;left:0;z-index:0;display:block;width:0;height:50%;box-shadow:-.25rem 0 .625rem .625rem var(--item-background);content:""}._tableHeaderActions_zlqta_1{position:sticky;right:0;width:var(--size-6);padding:0}._tableRow_zlqta_33:after{height:100%!important}._tableRow_zlqta_33[aria-selected=true]:after{height:100%!important}._selectAllCheckbox_zlqta_42 svg{transform:none!important}._tableNameCell_zlqta_47{display:flex;gap:var(--space-3);align-items:center}._tableNameCellSubtitle_zlqta_53{display:flex;flex-direction:column}._infiniteScrollTableContainerFullHeight_zlqta_58{width:100%;height:100%;overflow:auto}._iconCell_zlqta_64{width:100%!important;height:100%!important}
@@ -1,7 +1,7 @@
1
1
  import { ViewMode } from '../../types';
2
2
  import { FilterRowProps } from '../filter-row';
3
- import { FilterGroup } from '../filter-row/types';
4
3
  import { SortDropdownProps } from './sort-dropdown';
4
+ import { FilterGroup } from '../filter-row/types';
5
5
  export interface ActionBarProps extends Omit<FilterRowProps, 'filterGroups'> {
6
6
  filterGroups?: FilterGroup[];
7
7
  isIconColumnEnabled?: boolean;
@@ -1,4 +1,5 @@
1
1
  import { TableProps } from '@box/blueprint-web';
2
+ import { Item } from '@box/types';
2
3
  import { IconColumnVariant, Column, MetadataProps } from '../../types';
3
4
  export interface MetadataTableProps extends TableProps, MetadataProps {
4
5
  columns: Column[];
@@ -7,8 +8,9 @@ export interface MetadataTableProps extends TableProps, MetadataProps {
7
8
  isInfiniteScrollEnabled?: boolean;
8
9
  hasNextPage?: boolean;
9
10
  onGetNextPage?: () => void;
11
+ onInlineEditChange?: (item: Item, value: string, columnId: string) => void;
10
12
  placeholderRowsCount?: number;
11
13
  zoomLevel?: number;
12
14
  }
13
- declare const MetadataTable: ({ columns, isLoading, iconColumnVariant, isSelectAllEnabled, items, itemActionMenuProps, isInfiniteScrollEnabled, hasNextPage, onGetNextPage, placeholderRowsCount, zoomLevel, ...tableProps }: MetadataTableProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const MetadataTable: ({ columns, isLoading, iconColumnVariant, isSelectAllEnabled, items, itemActionMenuProps, isInfiniteScrollEnabled, hasNextPage, onInlineEditChange, onGetNextPage, placeholderRowsCount, zoomLevel, ...tableProps }: MetadataTableProps) => import("react/jsx-runtime").JSX.Element;
14
16
  export default MetadataTable;
@@ -0,0 +1 @@
1
+ export { default } from './inline-editing-cell';
@@ -0,0 +1,9 @@
1
+ import { Item } from '@box/types';
2
+ import { Column } from '../../../../types';
3
+ interface InlineEditingCellProps {
4
+ column: Column;
5
+ item: Item;
6
+ onInlineEditChange: (item: Item, value: string, columnId: string) => void;
7
+ }
8
+ declare const InlineEditingCell: ({ column, item, onInlineEditChange }: InlineEditingCellProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default InlineEditingCell;
@@ -1,9 +1,20 @@
1
1
  import { TableProps } from '@box/blueprint-web';
2
+ import { Item } from '@box/types';
2
3
  import { VirtualItem } from '@tanstack/react-virtual';
4
+ import { IconColumnVariant, Column } from '../../../types';
3
5
  import { MetadataTableProps } from '../metadata-table';
4
6
  interface TableBodyWithDataProps extends Omit<MetadataTableProps, keyof TableProps> {
5
7
  virtualItems?: VirtualItem[];
6
8
  columnCount?: number;
9
+ onInlineEditChange?: (item: Item, value: string, columnId: string) => void;
7
10
  }
8
- declare const TableBodyWithData: ({ columns, iconColumnVariant, isSelectAllEnabled, items, itemActionMenuProps, virtualItems, columnCount, zoomLevel, }: TableBodyWithDataProps) => import("react/jsx-runtime").JSX.Element;
11
+ type CellProps = {
12
+ item: Item;
13
+ column: Column;
14
+ iconColumnVariant: IconColumnVariant;
15
+ };
16
+ export interface DataCellProps extends CellProps {
17
+ onInlineEditChange?: (item: Item, value: string, columnId: string) => void;
18
+ }
19
+ declare const TableBodyWithData: ({ columns, iconColumnVariant, isSelectAllEnabled, items, itemActionMenuProps, virtualItems, columnCount, zoomLevel, onInlineEditChange, }: TableBodyWithDataProps) => import("react/jsx-runtime").JSX.Element;
9
20
  export default TableBodyWithData;
@@ -1,6 +1,7 @@
1
- import { TableProps } from '@box/blueprint-web';
2
1
  import { VirtualItem } from '@tanstack/react-virtual';
3
2
  import { useIntl } from 'react-intl';
3
+ import { TableProps } from '@box/blueprint-web';
4
+ import { Item } from '@box/types';
4
5
  import { IconColumnVariant, Column, MetadataProps } from '../../types';
5
6
  export interface TableRendererProps {
6
7
  tableHeader: React.ReactNode;
@@ -16,6 +17,7 @@ export interface TableRendererProps {
16
17
  style?: React.CSSProperties;
17
18
  columnCount?: number;
18
19
  zoomLevel?: number;
20
+ onInlineEditChange?: (item: Item, value: string, columnId: string) => void;
19
21
  }
20
- declare const TableRenderer: ({ tableHeader, columns, iconColumnVariant, isSelectAllEnabled, itemActionMenuProps, items, isLoading, formatMessage, tableProps, virtualItems, style, columnCount: passedColumnCount, zoomLevel, }: TableRendererProps) => import("react/jsx-runtime").JSX.Element;
22
+ declare const TableRenderer: ({ tableHeader, columns, iconColumnVariant, isSelectAllEnabled, itemActionMenuProps, items, isLoading, formatMessage, tableProps, virtualItems, style, columnCount: passedColumnCount, zoomLevel, onInlineEditChange, }: TableRendererProps) => import("react/jsx-runtime").JSX.Element;
21
23
  export default TableRenderer;
@@ -8,7 +8,8 @@ export interface Column extends Partial<ColumnProps> {
8
8
  headerRenderer?: (name: string, column: Column) => React.ReactNode | undefined;
9
9
  id: string;
10
10
  isInlineEditingEnabled?: boolean;
11
- subTitle?: string;
11
+ inlineEditingOptions?: string[];
12
+ subtitle?: string;
12
13
  textValue?: string;
13
14
  type?: MetadataFieldType;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.34.0",
3
+ "version": "0.35.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^11.12.0",
@@ -20,7 +20,7 @@
20
20
  "devDependencies": {
21
21
  "@box/blueprint-web": "^11.12.0",
22
22
  "@box/blueprint-web-assets": "^4.62.0",
23
- "@box/box-item-type-selector": "^0.62.3",
23
+ "@box/box-item-type-selector": "^0.63.0",
24
24
  "@box/eslint-plugin-blueprint": "*",
25
25
  "@box/item-icon": "^0.17.3",
26
26
  "@box/metadata-filter": "^1.18.0",