@box/metadata-view 0.59.0 → 0.60.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,96 +1,100 @@
1
- import { Row as L, Cell as n, Text as s, ActionCell as q } from "@box/blueprint-web";
2
- import N from "lodash/get";
3
- import { ItemTypeIcon as p } from "@box/item-icon";
4
- import E from "clsx";
5
- import { I as a } from "./types.js";
6
- import { THUMBNAIL_LIST_VIEW_HEIGHTS as y } from "../esm/lib/components/constants.js";
1
+ import { Row as L, Cell as n, Text as r, ActionCell as E } from "@box/blueprint-web";
2
+ import I from "lodash/get";
3
+ import { ItemTypeIcon as C } from "@box/item-icon";
4
+ import y from "clsx";
5
+ import { I as o } from "./types.js";
6
+ import { THUMBNAIL_LIST_VIEW_HEIGHTS as R } from "../esm/lib/components/constants.js";
7
7
  import { jsxs as b, jsx as e } from "react/jsx-runtime";
8
- import { ItemActionMenu as R } from "../esm/lib/components/item-action-menu/item-action-menu.js";
9
- import '../styles/index.css';const g = "_tableHeaderActionsWrapper_169qr_1", w = "_tableHeaderActions_169qr_1", k = "_tableRow_169qr_33", U = "_selectAllCheckbox_169qr_42", B = "_tableNameCell_169qr_47", W = "_tableNameCellSubtitle_169qr_53", j = "_tableNameCellIconInline_169qr_58", F = "_infiniteScrollTableContainerFullHeight_169qr_62", M = "_iconCell_169qr_68", i = {
10
- tableHeaderActionsWrapper: g,
11
- tableHeaderActions: w,
12
- tableRow: k,
13
- selectAllCheckbox: U,
14
- tableNameCell: B,
15
- tableNameCellSubtitle: W,
16
- tableNameCellIconInline: j,
17
- infiniteScrollTableContainerFullHeight: F,
18
- iconCell: M
19
- }, Q = ({
8
+ import { ItemActionMenu as g } from "../esm/lib/components/item-action-menu/item-action-menu.js";
9
+ import '../styles/index.css';const w = "_tableHeaderActionsWrapper_1a999_1", k = "_tableHeaderActions_1a999_1", U = "_tableRow_1a999_33", B = "_selectAllCheckbox_1a999_42", W = "_tableNameCell_1a999_47", j = "_tableNameCellTitle_1a999_53", F = "_hasSubtitle_1a999_57", M = "_tableNameCellText_1a999_62", $ = "_tableNameCellIconInline_1a999_67", v = "_infiniteScrollTableContainerFullHeight_1a999_71", O = "_iconCell_1a999_77", t = {
10
+ tableHeaderActionsWrapper: w,
11
+ tableHeaderActions: k,
12
+ tableRow: U,
13
+ selectAllCheckbox: B,
14
+ tableNameCell: W,
15
+ tableNameCellTitle: j,
16
+ hasSubtitle: F,
17
+ tableNameCellText: M,
18
+ tableNameCellIconInline: $,
19
+ infiniteScrollTableContainerFullHeight: v,
20
+ iconCell: O
21
+ }, Y = ({
20
22
  item: l,
21
23
  columns: h,
22
- iconColumnVariant: t,
23
- isSelectAllEnabled: C,
24
- itemActionMenuProps: d,
25
- areSelectionCheckboxesDisabled: u,
26
- zoomLevel: T = 0
24
+ iconColumnVariant: a,
25
+ isSelectAllEnabled: T,
26
+ itemActionMenuProps: _,
27
+ areSelectionCheckboxesDisabled: p,
28
+ zoomLevel: u = 0
27
29
  }) => /* @__PURE__ */ b(L, {
28
- className: i.tableRow,
30
+ className: t.tableRow,
29
31
  id: l.id,
30
- children: [t === a.COLUMN ? /* @__PURE__ */ e(n, {
32
+ children: [a === o.COLUMN ? /* @__PURE__ */ e(n, {
31
33
  style: {
32
- height: y[T]
34
+ height: R[u]
33
35
  },
34
- children: /* @__PURE__ */ e(p, {
35
- className: i.iconCell,
36
+ children: /* @__PURE__ */ e(C, {
37
+ className: t.iconCell,
36
38
  item: l
37
39
  })
38
- }, `item-type-icon-${l.id}`) : null, h.map((r) => {
40
+ }, `item-type-icon-${l.id}`) : null, h.map((c) => {
39
41
  const {
40
- cellRenderer: _,
41
- id: o,
42
- isItemMetadata: f,
43
- subtitle: S,
44
- textValue: H,
45
- type: x
46
- } = r, c = `${H}-${l.id}`, A = f ? o.split(".")[1] : o, I = N(l, A);
47
- if (o === "name" && (t === a.INLINE || t === a.INLINE_SUBTITLE))
42
+ cellRenderer: d,
43
+ id: s,
44
+ isItemMetadata: x,
45
+ subtitle: f,
46
+ textValue: S,
47
+ type: H
48
+ } = c, i = `${S}-${l.id}`, A = x ? s.split(".")[1] : s, m = I(l, A);
49
+ if (s === "name" && (a === o.INLINE || a === o.INLINE_SUBTITLE))
48
50
  return /* @__PURE__ */ e(n, {
49
51
  children: /* @__PURE__ */ b("div", {
50
- className: i.tableNameCell,
51
- children: [/* @__PURE__ */ e(p, {
52
+ className: t.tableNameCell,
53
+ children: [/* @__PURE__ */ e(C, {
52
54
  item: l
53
55
  }), /* @__PURE__ */ b("div", {
54
- className: E({
55
- [i.tableNameCellSubtitle]: t === a.INLINE_SUBTITLE
56
+ className: y(t.tableNameCellTitle, {
57
+ [t.hasSubtitle]: a === o.INLINE_SUBTITLE
56
58
  }),
57
- children: [/* @__PURE__ */ e(s, {
59
+ children: [/* @__PURE__ */ e(r, {
58
60
  as: "span",
59
- children: I
60
- }), t === a.INLINE_SUBTITLE ? /* @__PURE__ */ e(s, {
61
+ className: t.tableNameCellText,
62
+ children: m
63
+ }), a === o.INLINE_SUBTITLE ? /* @__PURE__ */ e(r, {
61
64
  as: "span",
65
+ className: t.tableNameCellText,
62
66
  color: "textOnLightSecondary",
63
- children: S
67
+ children: f
64
68
  }) : null]
65
69
  })]
66
70
  })
67
- }, c);
68
- if (_)
71
+ }, i);
72
+ if (d)
69
73
  return /* @__PURE__ */ e(n, {
70
- children: _(l, r)
71
- }, c);
72
- if (x === "multiSelect") {
73
- const m = N(l, o);
74
+ children: d(l, c)
75
+ }, i);
76
+ if (H === "multiSelect") {
77
+ const N = I(l, s);
74
78
  return /* @__PURE__ */ e(n, {
75
- children: m ? m.join(" ") : ""
76
- }, c);
79
+ children: N ? N.join(" ") : ""
80
+ }, i);
77
81
  }
78
82
  return /* @__PURE__ */ e(n, {
79
- children: /* @__PURE__ */ e(s, {
83
+ children: /* @__PURE__ */ e(r, {
80
84
  as: "span",
81
- children: I
85
+ children: m
82
86
  })
83
- }, c);
84
- }), C && /* @__PURE__ */ e(q, {
85
- isCheckboxDisabled: u,
86
- children: (r) => d ? /* @__PURE__ */ e(R, {
87
- ...d,
87
+ }, i);
88
+ }), T && /* @__PURE__ */ e(E, {
89
+ isCheckboxDisabled: p,
90
+ children: (c) => _ ? /* @__PURE__ */ e(g, {
91
+ ..._,
88
92
  item: l,
89
- onOpenChange: r
93
+ onOpenChange: c
90
94
  }) : null
91
95
  })]
92
96
  }, l.id);
93
97
  export {
94
- Q as T,
95
- i as s
98
+ Y as T,
99
+ t as s
96
100
  };
@@ -1,11 +1,12 @@
1
- import { MetadataStringField as u, MetadataMultiSelectField as f, MetadataEnumField as s, MetadataFloatField as m, MetadataDateField as F } from "@box/metadata-filter";
2
- import { useIntl as n } from "react-intl";
3
- import { MetadataFileField as M } from "../metadata-value/metadata-file-field.js";
4
- import { MetadataLocationField as x } from "../metadata-value/metadata-location-field.js";
5
- import { MetadataRadioField as b } from "../metadata-value/metadata-radio-field.js";
6
- import { MetadataSearchField as S } from "../metadata-value/metadata-search-field.js";
1
+ import { MetadataStringField as f, MetadataMultiSelectField as s, MetadataEnumField as m, MetadataFloatField as F, MetadataDateField as M } from "@box/metadata-filter";
2
+ import { useIntl as d } from "react-intl";
3
+ import { MetadataFileField as x } from "../metadata-value/metadata-file-field.js";
4
+ import { MetadataLocationField as b } from "../metadata-value/metadata-location-field.js";
5
+ import { MetadataRadioField as h } from "../metadata-value/metadata-radio-field.js";
6
+ import { MetadataCheckboxField as S } from "../metadata-value/metadata-checkbox-field.js";
7
+ import { MetadataSearchField as g } from "../metadata-value/metadata-search-field.js";
7
8
  import { jsx as t } from "react/jsx-runtime";
8
- const i = (e) => `metadata.fields.${e}`, g = ({
9
+ const i = (e) => `metadata.fields.${e}`, P = ({
9
10
  id: e,
10
11
  name: a,
11
12
  placeholder: l,
@@ -13,19 +14,20 @@ const i = (e) => `metadata.fields.${e}`, g = ({
13
14
  }) => {
14
15
  switch (r) {
15
16
  case "search":
16
- return /* @__PURE__ */ t(S, {
17
+ return /* @__PURE__ */ t(g, {
17
18
  id: e,
18
19
  name: a,
19
20
  placeholder: l
20
21
  });
21
22
  case "default":
22
23
  default:
23
- return /* @__PURE__ */ t(u, {
24
+ return /* @__PURE__ */ t(f, {
24
25
  fieldNamePrefix: i(e),
25
- label: a || ""
26
+ label: a || "",
27
+ placeholder: l
26
28
  });
27
29
  }
28
- }, h = ({
30
+ }, N = ({
29
31
  id: e,
30
32
  name: a,
31
33
  variant: l,
@@ -33,56 +35,63 @@ const i = (e) => `metadata.fields.${e}`, g = ({
33
35
  }) => {
34
36
  switch (l) {
35
37
  case "file":
36
- return /* @__PURE__ */ t(M, {
38
+ return /* @__PURE__ */ t(x, {
37
39
  id: e
38
40
  });
41
+ case "checkbox":
42
+ return /* @__PURE__ */ t(S, {
43
+ id: e,
44
+ name: a
45
+ });
39
46
  case "default":
40
47
  default:
41
- return /* @__PURE__ */ t(f, {
48
+ return /* @__PURE__ */ t(s, {
42
49
  fieldNamePrefix: i(e),
43
50
  label: a || "",
44
51
  portalElement: r
45
52
  });
46
53
  }
47
- }, P = ({
54
+ }, w = ({
48
55
  id: e,
49
56
  name: a,
50
57
  parentRef: l,
51
58
  variant: r,
52
59
  renderer: c,
53
- triggerCallback: d
60
+ triggerCallback: o,
61
+ placeholder: n
54
62
  }) => {
55
63
  const {
56
- locale: o
57
- } = n();
64
+ locale: u
65
+ } = d();
58
66
  switch (r) {
59
67
  case "file":
60
- return /* @__PURE__ */ t(x, {
68
+ return /* @__PURE__ */ t(b, {
61
69
  id: e,
62
70
  renderer: c,
63
- triggerSetValueCallback: d
71
+ triggerSetValueCallback: o
64
72
  });
65
73
  case "radio":
66
- return /* @__PURE__ */ t(b, {
74
+ return /* @__PURE__ */ t(h, {
67
75
  id: e,
68
76
  name: a
69
77
  });
70
78
  case "default":
71
79
  default:
72
- return /* @__PURE__ */ t(s, {
80
+ return /* @__PURE__ */ t(m, {
73
81
  fieldNamePrefix: i(e),
74
82
  label: a || "",
75
- locale: o,
83
+ locale: u,
84
+ placeholder: n,
76
85
  portalElement: l
77
86
  });
78
87
  }
79
- }, N = ({
88
+ }, E = ({
80
89
  id: e,
81
90
  name: a
82
- }) => /* @__PURE__ */ t(m, {
91
+ }) => /* @__PURE__ */ t(F, {
83
92
  fieldNamePrefix: i(e),
84
93
  label: a || ""
85
- }), w = ({
94
+ }), k = ({
86
95
  customLabels: e,
87
96
  canUseRelativeDates: a,
88
97
  customDateFilterOptions: l,
@@ -90,39 +99,39 @@ const i = (e) => `metadata.fields.${e}`, g = ({
90
99
  name: c
91
100
  }) => {
92
101
  const {
93
- locale: d
94
- } = n();
95
- return /* @__PURE__ */ t(F, {
102
+ locale: o
103
+ } = d();
104
+ return /* @__PURE__ */ t(M, {
96
105
  canUseRelativeDates: a,
97
106
  customDateFilterOptions: l,
98
107
  customFieldLabels: e,
99
108
  direction: "vertical",
100
109
  fieldNamePrefix: i(r),
101
110
  label: c || "",
102
- locale: d
111
+ locale: o
103
112
  });
104
- }, y = ({
113
+ }, R = ({
105
114
  ...e
106
115
  }) => {
107
116
  switch (e.fieldType) {
108
117
  case "string":
109
- return /* @__PURE__ */ t(g, {
118
+ return /* @__PURE__ */ t(P, {
110
119
  ...e
111
120
  });
112
121
  case "float":
113
- return /* @__PURE__ */ t(N, {
122
+ return /* @__PURE__ */ t(E, {
114
123
  ...e
115
124
  });
116
125
  case "date":
117
- return /* @__PURE__ */ t(w, {
126
+ return /* @__PURE__ */ t(k, {
118
127
  ...e
119
128
  });
120
129
  case "multiSelect":
121
- return /* @__PURE__ */ t(h, {
130
+ return /* @__PURE__ */ t(N, {
122
131
  ...e
123
132
  });
124
133
  case "enum":
125
- return /* @__PURE__ */ t(P, {
134
+ return /* @__PURE__ */ t(w, {
126
135
  ...e
127
136
  });
128
137
  default:
@@ -130,5 +139,5 @@ const i = (e) => `metadata.fields.${e}`, g = ({
130
139
  }
131
140
  };
132
141
  export {
133
- y as Filter
142
+ R as Filter
134
143
  };
@@ -1,130 +1,132 @@
1
- import { TableBody as T, Row as g, Cell as m, ActionCell as x, Text as u } from "@box/blueprint-web";
1
+ import { TableBody as C, Row as L, Cell as h, ActionCell as g, Text as u } from "@box/blueprint-web";
2
2
  import { ItemTypeIcon as y } from "@box/item-icon";
3
3
  import R from "clsx";
4
4
  import $ from "lodash/get";
5
- import c from "react";
6
- import { I as f } from "../../../../../chunks/types.js";
5
+ import I from "react";
6
+ import { I as N } from "../../../../../chunks/types.js";
7
7
  import { THUMBNAIL_LIST_VIEW_HEIGHTS as S } from "../../constants.js";
8
- import { s as h, T as w } from "../../../../../chunks/index.js";
9
- import { jsx as r, jsxs as C } from "react/jsx-runtime";
8
+ import { s as i, T as w } from "../../../../../chunks/index.js";
9
+ import { jsx as l, jsxs as T } from "react/jsx-runtime";
10
10
  import { InlineEditingCell as B } from "./inline-editing-cell/inline-editing-cell.js";
11
11
  import { ItemActionMenu as _ } from "../../item-action-menu/item-action-menu.js";
12
12
  import { GhostTableRow as k } from "./ghost-table-row/ghost-table-row.js";
13
- const E = (t, e, l) => {
14
- const n = l ? e.split(".")[1] : e;
13
+ const b = (t, e, r) => {
14
+ const n = r ? e.split(".")[1] : e;
15
15
  return $(t, n);
16
- }, M = /* @__PURE__ */ c.memo(({
16
+ }, M = /* @__PURE__ */ I.memo(({
17
17
  item: t,
18
18
  column: e,
19
- iconColumnVariant: l
19
+ iconColumnVariant: r
20
20
  }) => {
21
21
  const {
22
22
  id: n,
23
23
  isItemMetadata: s,
24
- subtitle: i,
25
- textValue: I
26
- } = e, a = `${I}-${t.id}`;
27
- return /* @__PURE__ */ r(m, {
28
- children: /* @__PURE__ */ C("div", {
29
- className: h.tableNameCell,
30
- children: [/* @__PURE__ */ r(y, {
31
- className: h.tableNameCellIconInline,
24
+ subtitle: a,
25
+ textValue: m
26
+ } = e, d = `${m}-${t.id}`;
27
+ return /* @__PURE__ */ l(h, {
28
+ children: /* @__PURE__ */ T("div", {
29
+ className: i.tableNameCell,
30
+ children: [/* @__PURE__ */ l(y, {
31
+ className: i.tableNameCellIconInline,
32
32
  item: t
33
- }), /* @__PURE__ */ C("div", {
34
- className: R({
35
- [h.tableNameCellSubtitle]: l === f.INLINE_SUBTITLE
33
+ }), /* @__PURE__ */ T("div", {
34
+ className: R(i.tableNameCellTitle, {
35
+ [i.hasSubtitle]: r === N.INLINE_SUBTITLE
36
36
  }),
37
- children: [/* @__PURE__ */ r(u, {
37
+ children: [/* @__PURE__ */ l(u, {
38
38
  as: "span",
39
- children: E(t, n, s)
40
- }), l === f.INLINE_SUBTITLE && /* @__PURE__ */ r(u, {
39
+ className: i.tableNameCellText,
40
+ children: b(t, n, s)
41
+ }), r === N.INLINE_SUBTITLE && /* @__PURE__ */ l(u, {
41
42
  as: "span",
43
+ className: i.tableNameCellText,
42
44
  color: "textOnLightSecondary",
43
- children: i
45
+ children: a
44
46
  })]
45
47
  })]
46
48
  })
47
- }, a);
48
- }), U = /* @__PURE__ */ c.memo(({
49
+ }, d);
50
+ }), U = /* @__PURE__ */ I.memo(({
49
51
  item: t,
50
52
  column: e
51
53
  }) => {
52
54
  var n;
53
- const l = `${e.textValue}-${t.id}`;
54
- return /* @__PURE__ */ r(m, {
55
+ const r = `${e.textValue}-${t.id}`;
56
+ return /* @__PURE__ */ l(h, {
55
57
  children: (n = e.cellRenderer) == null ? void 0 : n.call(e, t, e)
56
- }, l);
57
- }), W = /* @__PURE__ */ c.memo(({
58
+ }, r);
59
+ }), W = /* @__PURE__ */ I.memo(({
58
60
  item: t,
59
61
  column: e
60
62
  }) => {
61
- const l = `${e.textValue}-${t.id}`, n = $(t, e.id);
62
- return n ? /* @__PURE__ */ r(m, {
63
+ const r = `${e.textValue}-${t.id}`, n = $(t, e.id);
64
+ return n ? /* @__PURE__ */ l(h, {
63
65
  children: n.join(" ")
64
- }, l) : /* @__PURE__ */ r(m, {}, l);
65
- }), j = /* @__PURE__ */ c.memo(({
66
+ }, r) : /* @__PURE__ */ l(h, {}, r);
67
+ }), j = /* @__PURE__ */ I.memo(({
66
68
  item: t,
67
69
  column: e
68
70
  }) => {
69
71
  const {
70
- id: l,
72
+ id: r,
71
73
  isItemMetadata: n,
72
74
  textValue: s
73
- } = e, i = `${s}-${t.id}`;
74
- return /* @__PURE__ */ r(m, {
75
- children: /* @__PURE__ */ r(u, {
75
+ } = e, a = `${s}-${t.id}`;
76
+ return /* @__PURE__ */ l(h, {
77
+ children: /* @__PURE__ */ l(u, {
76
78
  as: "span",
77
- children: E(t, l, n)
79
+ children: b(t, r, n)
78
80
  })
79
- }, i);
80
- }), D = /* @__PURE__ */ c.memo(({
81
+ }, a);
82
+ }), D = /* @__PURE__ */ I.memo(({
81
83
  item: t,
82
84
  column: e,
83
- iconColumnVariant: l,
85
+ iconColumnVariant: r,
84
86
  onInlineEditChange: n
85
87
  }) => {
86
88
  const {
87
89
  cellRenderer: s,
88
- id: i,
89
- isInlineEditingEnabled: I,
90
- type: a
90
+ id: a,
91
+ isInlineEditingEnabled: m,
92
+ type: d
91
93
  } = e;
92
- return i === "item.name" && (l === f.INLINE || l === f.INLINE_SUBTITLE) ? /* @__PURE__ */ r(M, {
94
+ return a === "item.name" && (r === N.INLINE || r === N.INLINE_SUBTITLE) ? /* @__PURE__ */ l(M, {
93
95
  column: e,
94
- iconColumnVariant: l,
96
+ iconColumnVariant: r,
95
97
  item: t
96
- }) : s ? /* @__PURE__ */ r(U, {
98
+ }) : s ? /* @__PURE__ */ l(U, {
97
99
  column: e,
98
100
  item: t
99
- }) : I && (a === "multiSelect" || a === "enum") ? /* @__PURE__ */ r(B, {
101
+ }) : m && (d === "multiSelect" || d === "enum") ? /* @__PURE__ */ l(B, {
100
102
  column: e,
101
103
  item: t,
102
104
  onInlineEditChange: n
103
- }, `${e.id}-${t.id}`) : a === "multiSelect" ? /* @__PURE__ */ r(W, {
105
+ }, `${e.id}-${t.id}`) : d === "multiSelect" ? /* @__PURE__ */ l(W, {
104
106
  column: e,
105
107
  item: t
106
- }) : /* @__PURE__ */ r(j, {
108
+ }) : /* @__PURE__ */ l(j, {
107
109
  column: e,
108
110
  item: t
109
111
  });
110
- }), G = /* @__PURE__ */ c.memo(({
112
+ }), G = /* @__PURE__ */ I.memo(({
111
113
  item: t,
112
114
  zoomLevel: e
113
- }) => /* @__PURE__ */ r(m, {
115
+ }) => /* @__PURE__ */ l(h, {
114
116
  style: {
115
117
  height: S[e]
116
118
  },
117
- children: /* @__PURE__ */ r(y, {
118
- className: h.iconCell,
119
+ children: /* @__PURE__ */ l(y, {
120
+ className: i.iconCell,
119
121
  item: t
120
122
  })
121
- }, `item-type-icon-${t.id}`)), H = /* @__PURE__ */ c.memo(({
123
+ }, `item-type-icon-${t.id}`)), H = /* @__PURE__ */ I.memo(({
122
124
  item: t,
123
125
  itemActionMenuProps: e,
124
- isCheckboxDisabled: l
125
- }) => /* @__PURE__ */ r(x, {
126
- isCheckboxDisabled: l,
127
- children: (n) => e ? /* @__PURE__ */ r(_, {
126
+ isCheckboxDisabled: r
127
+ }) => /* @__PURE__ */ l(g, {
128
+ isCheckboxDisabled: r,
129
+ children: (n) => e ? /* @__PURE__ */ l(_, {
128
130
  ...e,
129
131
  item: t,
130
132
  onOpenChange: n
@@ -132,54 +134,54 @@ const E = (t, e, l) => {
132
134
  })), z = ({
133
135
  columns: t,
134
136
  iconColumnVariant: e,
135
- isSelectAllEnabled: l,
137
+ isSelectAllEnabled: r,
136
138
  items: n,
137
139
  itemActionMenuProps: s,
138
- areSelectionCheckboxesDisabled: i,
139
- virtualItems: I,
140
- columnCount: a,
141
- zoomLevel: N,
142
- onInlineEditChange: L
140
+ areSelectionCheckboxesDisabled: a,
141
+ virtualItems: m,
142
+ columnCount: d,
143
+ zoomLevel: p,
144
+ onInlineEditChange: x
143
145
  }) => {
144
- const b = e === f.COLUMN;
145
- if (I) {
146
- const o = (d) => /* @__PURE__ */ r(k, {
147
- columnLength: a || 0,
148
- rowKey: `ghost-${d}`
149
- }), p = (d) => /* @__PURE__ */ r(w, {
150
- areSelectionCheckboxesDisabled: i,
146
+ const E = e === N.COLUMN;
147
+ if (m) {
148
+ const o = (c) => /* @__PURE__ */ l(k, {
149
+ columnLength: d || 0,
150
+ rowKey: `ghost-${c}`
151
+ }), f = (c) => /* @__PURE__ */ l(w, {
152
+ areSelectionCheckboxesDisabled: a,
151
153
  columns: t,
152
154
  iconColumnVariant: e,
153
- isSelectAllEnabled: l,
154
- item: d,
155
+ isSelectAllEnabled: r,
156
+ item: c,
155
157
  itemActionMenuProps: s,
156
- zoomLevel: N
158
+ zoomLevel: p
157
159
  });
158
- return /* @__PURE__ */ r(T, {
159
- items: I,
160
+ return /* @__PURE__ */ l(C, {
161
+ items: m,
160
162
  children: ({
161
- index: d
162
- }) => d >= n.length ? o(d) : p(n[d])
163
+ index: c
164
+ }) => c >= n.length ? o(c) : f(n[c])
163
165
  });
164
166
  }
165
- return /* @__PURE__ */ r(T, {
167
+ return /* @__PURE__ */ l(C, {
166
168
  items: n.map((o) => ({
167
169
  key: o.id,
168
170
  ...o
169
171
  })),
170
- children: (o) => /* @__PURE__ */ C(g, {
171
- className: h.tableRow,
172
+ children: (o) => /* @__PURE__ */ T(L, {
173
+ className: i.tableRow,
172
174
  id: o.id,
173
- children: [b && /* @__PURE__ */ r(G, {
175
+ children: [E && /* @__PURE__ */ l(G, {
174
176
  item: o,
175
- zoomLevel: N
176
- }), t.map((p) => /* @__PURE__ */ r(D, {
177
- column: p,
177
+ zoomLevel: p
178
+ }), t.map((f) => /* @__PURE__ */ l(D, {
179
+ column: f,
178
180
  iconColumnVariant: e,
179
181
  item: o,
180
- onInlineEditChange: L
181
- }, `${p.textValue}-${o.id}`)), l && /* @__PURE__ */ r(H, {
182
- isCheckboxDisabled: i,
182
+ onInlineEditChange: x
183
+ }, `${f.textValue}-${o.id}`)), r && /* @__PURE__ */ l(H, {
184
+ isCheckboxDisabled: a,
183
185
  item: o,
184
186
  itemActionMenuProps: s
185
187
  })]
@@ -0,0 +1,35 @@
1
+ import { useFormikContext as C } from "formik";
2
+ import { Checkbox as c } from "@box/blueprint-web";
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ const b = ({
5
+ id: a,
6
+ name: i
7
+ }) => {
8
+ var l, s, r;
9
+ const {
10
+ values: n,
11
+ setFieldValue: u
12
+ } = C(), h = ((l = n.metadata.fields[a]) == null ? void 0 : l.options) || [], d = ((r = (s = n.metadata.fields[a]) == null ? void 0 : s.value) == null ? void 0 : r.enum) || [], f = (e, o) => {
13
+ const t = new Set(d);
14
+ o ? t.add(e) : t.delete(e), u(`metadata.fields.${a}.value.enum`, Array.from(t));
15
+ };
16
+ return /* @__PURE__ */ m(c.Legend, {
17
+ header: i,
18
+ children: h.map(({
19
+ key: e
20
+ }) => {
21
+ const o = d.includes(e);
22
+ return /* @__PURE__ */ m(c.Item, {
23
+ checked: o,
24
+ label: e,
25
+ onCheckedChange: (t) => {
26
+ f(e, t === !0);
27
+ },
28
+ value: e
29
+ }, e);
30
+ })
31
+ });
32
+ };
33
+ export {
34
+ b as MetadataCheckboxField
35
+ };
@@ -1 +1 @@
1
- ._tableHeaderActionsWrapper_169qr_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_169qr_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_169qr_1{position:sticky;right:0;width:var(--size-6);padding:0}._tableRow_169qr_33:after{height:100%!important}._tableRow_169qr_33[aria-selected=true]:after{height:100%!important}._selectAllCheckbox_169qr_42 svg{transform:none!important}._tableNameCell_169qr_47{display:flex;gap:var(--space-3);align-items:center}._tableNameCellSubtitle_169qr_53{display:flex;flex-direction:column}._tableNameCellIconInline_169qr_58{flex-shrink:0}._infiniteScrollTableContainerFullHeight_169qr_62{width:100%;height:100%;overflow:auto}._iconCell_169qr_68{width:100%!important;height:100%!important}
1
+ ._tableHeaderActionsWrapper_1a999_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_1a999_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_1a999_1{position:sticky;right:0;width:var(--size-6);padding:0}._tableRow_1a999_33:after{height:100%!important}._tableRow_1a999_33[aria-selected=true]:after{height:100%!important}._selectAllCheckbox_1a999_42 svg{transform:none!important}._tableNameCell_1a999_47{display:flex;gap:var(--space-3);align-items:center}._tableNameCellTitle_1a999_53{overflow:hidden;text-overflow:ellipsis}._tableNameCellTitle_1a999_53._hasSubtitle_1a999_57{display:flex;flex-direction:column}._tableNameCellText_1a999_62{overflow:hidden;text-overflow:ellipsis}._tableNameCellIconInline_1a999_67{flex-shrink:0}._infiniteScrollTableContainerFullHeight_1a999_71{width:100%;height:100%;overflow:auto}._iconCell_1a999_77{width:100%!important;height:100%!important}
@@ -0,0 +1,5 @@
1
+ export interface MetadataCheckboxFieldProps {
2
+ id: string;
3
+ name: string;
4
+ }
5
+ export declare const MetadataCheckboxField: ({ id, name }: MetadataCheckboxFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { ColumnProps } from '@box/blueprint-web';
2
2
  import { Item } from '@box/types';
3
3
  import { ItemActionMenuProps } from './components/item-action-menu';
4
4
  export type MetadataFieldType = 'date' | 'enum' | 'float' | 'multiSelect' | 'string';
5
- export type FilterVariant = 'default' | 'search' | 'file' | 'radio' | 'relative';
5
+ export type FilterVariant = 'default' | 'search' | 'file' | 'radio' | 'relative' | 'checkbox';
6
6
  export interface Column extends Partial<ColumnProps> {
7
7
  cellRenderer?: (item: Item, column: Column) => React.ReactNode | undefined;
8
8
  headerRenderer?: (name: string, column: Column) => React.ReactNode | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.59.0",
3
+ "version": "0.60.0",
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.80.0",
21
+ "@box/blueprint-web": "^12.81.0",
22
22
  "@box/blueprint-web-assets": "^4.71.0",
23
- "@box/box-item-type-selector": "^0.76.3",
23
+ "@box/box-item-type-selector": "^0.76.4",
24
24
  "@box/eslint-plugin-blueprint": "1.0.5",
25
- "@box/item-icon": "^0.30.3",
26
- "@box/metadata-filter": "^1.35.1",
25
+ "@box/item-icon": "^0.30.4",
26
+ "@box/metadata-filter": "^1.36.0",
27
27
  "@box/storybook-utils": "0.14.7",
28
28
  "@box/types": "0.2.1",
29
29
  "@tanstack/react-virtual": "^3.10.8",