@box/metadata-view 1.11.0 → 1.11.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,12 +1,12 @@
|
|
|
1
|
-
import { TableBody as $, Row as S, Cell as m, ActionCell as g, Text as
|
|
1
|
+
import { TableBody as $, Row as S, Cell as m, ActionCell as g, Text as T } from "@box/blueprint-web";
|
|
2
2
|
import { ItemTypeIcon as b } from "@box/item-icon";
|
|
3
|
-
import
|
|
3
|
+
import w from "clsx";
|
|
4
4
|
import E from "lodash/get";
|
|
5
5
|
import I from "react";
|
|
6
6
|
import { I as N } from "../../../../../chunks/types.js";
|
|
7
|
-
import { THUMBNAIL_LIST_VIEW_HEIGHTS as
|
|
7
|
+
import { THUMBNAIL_LIST_VIEW_HEIGHTS as R } from "../../constants.js";
|
|
8
8
|
import { s as d, T as B } from "../../../../../chunks/index.js";
|
|
9
|
-
import { jsx as l, jsxs as
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
import { InlineEditingCell as _ } from "./inline-editing-cell/inline-editing-cell.js";
|
|
11
11
|
import { ItemActionMenu as M } from "../../item-action-menu/item-action-menu.js";
|
|
12
12
|
import { GhostTableRow as U } from "./ghost-table-row/ghost-table-row.js";
|
|
@@ -20,25 +20,25 @@ const x = (e, t, r) => {
|
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
22
|
id: n,
|
|
23
|
-
isItemMetadata:
|
|
23
|
+
isItemMetadata: o,
|
|
24
24
|
subtitle: a,
|
|
25
25
|
textValue: h
|
|
26
26
|
} = e, i = `${h}-${r.id}`;
|
|
27
27
|
return /* @__PURE__ */ l(m, {
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ u("div", {
|
|
29
29
|
className: d.tableNameCell,
|
|
30
30
|
children: [/* @__PURE__ */ l(b, {
|
|
31
31
|
className: d.tableNameCellIconInline,
|
|
32
32
|
item: r
|
|
33
|
-
}), /* @__PURE__ */
|
|
34
|
-
className:
|
|
33
|
+
}), /* @__PURE__ */ u("div", {
|
|
34
|
+
className: w(d.tableNameCellTitle, {
|
|
35
35
|
[d.hasSubtitle]: t === N.INLINE_SUBTITLE
|
|
36
36
|
}),
|
|
37
|
-
children: [/* @__PURE__ */ l(
|
|
37
|
+
children: [/* @__PURE__ */ l(T, {
|
|
38
38
|
as: "span",
|
|
39
39
|
className: d.tableNameCellText,
|
|
40
|
-
children: x(r, n,
|
|
41
|
-
}), t === N.INLINE_SUBTITLE && /* @__PURE__ */ l(
|
|
40
|
+
children: x(r, n, o)
|
|
41
|
+
}), t === N.INLINE_SUBTITLE && /* @__PURE__ */ l(T, {
|
|
42
42
|
as: "span",
|
|
43
43
|
className: d.tableNameCellText,
|
|
44
44
|
color: "textOnLightSecondary",
|
|
@@ -64,37 +64,37 @@ const x = (e, t, r) => {
|
|
|
64
64
|
return n ? /* @__PURE__ */ l(m, {
|
|
65
65
|
children: n.join(" ")
|
|
66
66
|
}, r) : /* @__PURE__ */ l(m, {}, r);
|
|
67
|
-
}),
|
|
67
|
+
}), D = /* @__PURE__ */ I.memo(({
|
|
68
68
|
column: e,
|
|
69
69
|
item: t
|
|
70
70
|
}) => {
|
|
71
71
|
const {
|
|
72
72
|
id: r,
|
|
73
73
|
isItemMetadata: n,
|
|
74
|
-
textValue:
|
|
75
|
-
} = e, a = `${
|
|
74
|
+
textValue: o
|
|
75
|
+
} = e, a = `${o}-${t.id}`;
|
|
76
76
|
return /* @__PURE__ */ l(m, {
|
|
77
|
-
children: /* @__PURE__ */ l(
|
|
77
|
+
children: /* @__PURE__ */ l(T, {
|
|
78
78
|
as: "span",
|
|
79
79
|
children: x(t, r, n)
|
|
80
80
|
})
|
|
81
81
|
}, a);
|
|
82
|
-
}),
|
|
82
|
+
}), G = /* @__PURE__ */ I.memo(({
|
|
83
83
|
column: e,
|
|
84
84
|
iconColumnVariant: t,
|
|
85
85
|
item: r,
|
|
86
86
|
onInlineEditChange: n
|
|
87
87
|
}) => {
|
|
88
88
|
const {
|
|
89
|
-
cellRenderer:
|
|
89
|
+
cellRenderer: o,
|
|
90
90
|
id: a,
|
|
91
91
|
isInlineEditingEnabled: h,
|
|
92
92
|
type: i
|
|
93
|
-
} = e,
|
|
94
|
-
return
|
|
93
|
+
} = e, f = a === "item.name" && (t === N.INLINE || t === N.INLINE_SUBTITLE);
|
|
94
|
+
return o ? /* @__PURE__ */ l(W, {
|
|
95
95
|
column: e,
|
|
96
96
|
item: r
|
|
97
|
-
}) :
|
|
97
|
+
}) : f ? /* @__PURE__ */ l(k, {
|
|
98
98
|
column: e,
|
|
99
99
|
iconColumnVariant: t,
|
|
100
100
|
item: r
|
|
@@ -105,22 +105,22 @@ const x = (e, t, r) => {
|
|
|
105
105
|
}, `${e.id}-${r.id}`) : i === "multiSelect" ? /* @__PURE__ */ l(j, {
|
|
106
106
|
column: e,
|
|
107
107
|
item: r
|
|
108
|
-
}) : /* @__PURE__ */ l(
|
|
108
|
+
}) : /* @__PURE__ */ l(D, {
|
|
109
109
|
column: e,
|
|
110
110
|
item: r
|
|
111
111
|
});
|
|
112
|
-
}),
|
|
112
|
+
}), H = /* @__PURE__ */ I.memo(({
|
|
113
113
|
item: e,
|
|
114
114
|
zoomLevel: t
|
|
115
115
|
}) => /* @__PURE__ */ l(m, {
|
|
116
116
|
style: {
|
|
117
|
-
height:
|
|
117
|
+
height: R[t]
|
|
118
118
|
},
|
|
119
119
|
children: /* @__PURE__ */ l(b, {
|
|
120
120
|
className: d.iconCell,
|
|
121
121
|
item: e
|
|
122
122
|
})
|
|
123
|
-
}, `item-type-icon-${e.id}`)),
|
|
123
|
+
}, `item-type-icon-${e.id}`)), A = /* @__PURE__ */ I.memo(({
|
|
124
124
|
item: e,
|
|
125
125
|
itemActionMenuProps: t,
|
|
126
126
|
isCheckboxDisabled: r
|
|
@@ -136,58 +136,59 @@ const x = (e, t, r) => {
|
|
|
136
136
|
columnCount: t,
|
|
137
137
|
columns: r,
|
|
138
138
|
iconColumnVariant: n,
|
|
139
|
-
items:
|
|
139
|
+
items: o,
|
|
140
140
|
itemActionMenuProps: a,
|
|
141
141
|
onInlineEditChange: h,
|
|
142
142
|
onTableRowClick: i,
|
|
143
|
-
shouldRenderActionColumn:
|
|
143
|
+
shouldRenderActionColumn: f,
|
|
144
144
|
virtualItems: C,
|
|
145
145
|
zoomLevel: y
|
|
146
146
|
}) => {
|
|
147
147
|
const L = n === N.COLUMN;
|
|
148
148
|
if (C) {
|
|
149
|
-
const
|
|
149
|
+
const s = (c) => /* @__PURE__ */ l(U, {
|
|
150
150
|
columnLength: t || 0,
|
|
151
151
|
rowKey: `ghost-${c}`
|
|
152
|
-
}),
|
|
152
|
+
}), p = (c) => /* @__PURE__ */ l(B, {
|
|
153
153
|
areSelectionCheckboxesDisabled: e,
|
|
154
154
|
columns: r,
|
|
155
155
|
iconColumnVariant: n,
|
|
156
156
|
item: c,
|
|
157
157
|
itemActionMenuProps: a,
|
|
158
158
|
onTableRowClick: i,
|
|
159
|
+
shouldRenderActionColumn: f,
|
|
159
160
|
zoomLevel: y
|
|
160
161
|
});
|
|
161
162
|
return /* @__PURE__ */ l($, {
|
|
162
163
|
items: C,
|
|
163
164
|
children: ({
|
|
164
165
|
index: c
|
|
165
|
-
}) => c >=
|
|
166
|
+
}) => c >= o.length ? s(c) : p(o[c])
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
return /* @__PURE__ */ l($, {
|
|
169
|
-
items:
|
|
170
|
-
key:
|
|
171
|
-
...
|
|
170
|
+
items: o.map((s) => ({
|
|
171
|
+
key: s.id,
|
|
172
|
+
...s
|
|
172
173
|
})),
|
|
173
|
-
children: (
|
|
174
|
+
children: (s) => /* @__PURE__ */ u(S, {
|
|
174
175
|
className: d.tableRow,
|
|
175
|
-
id:
|
|
176
|
-
onAction: () => i(
|
|
177
|
-
children: [L && /* @__PURE__ */ l(
|
|
178
|
-
item:
|
|
176
|
+
id: s.id,
|
|
177
|
+
onAction: () => i(s),
|
|
178
|
+
children: [L && /* @__PURE__ */ l(H, {
|
|
179
|
+
item: s,
|
|
179
180
|
zoomLevel: y
|
|
180
|
-
}), r.map((
|
|
181
|
-
column:
|
|
181
|
+
}), r.map((p) => /* @__PURE__ */ l(G, {
|
|
182
|
+
column: p,
|
|
182
183
|
iconColumnVariant: n,
|
|
183
|
-
item:
|
|
184
|
+
item: s,
|
|
184
185
|
onInlineEditChange: h
|
|
185
|
-
}, `${
|
|
186
|
+
}, `${p.textValue}-${s.id}`)), f && /* @__PURE__ */ l(A, {
|
|
186
187
|
isCheckboxDisabled: e,
|
|
187
|
-
item:
|
|
188
|
+
item: s,
|
|
188
189
|
itemActionMenuProps: a
|
|
189
190
|
})]
|
|
190
|
-
},
|
|
191
|
+
}, s.id)
|
|
191
192
|
});
|
|
192
193
|
};
|
|
193
194
|
export {
|