@box/metadata-view 0.48.10 → 0.48.11
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.
- package/dist/chunks/index.js +47 -46
- package/dist/esm/lib/components/action-bar/action-bar.js +2 -2
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +21 -21
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +76 -73
- package/dist/esm/lib/components/metadata-table/table-renderer.js +22 -23
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +33 -24
- package/dist/esm/lib/metadata-view.js +54 -50
- package/dist/styles/index.css +1 -1
- package/dist/types/lib/components/action-bar/action-bar.d.ts +3 -3
- package/dist/types/lib/components/sort-dropdown/sort-dropdown.d.ts +6 -5
- package/dist/types/lib/metadata-view.d.ts +6 -2
- package/dist/types/lib/test-utils/mock-data.d.ts +1 -1
- package/package.json +1 -1
package/dist/chunks/index.js
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { Row as L, Cell as
|
|
2
|
-
import
|
|
3
|
-
import { ItemTypeIcon as
|
|
1
|
+
import { Row as L, Cell as o, Text as s, ActionCell as x } from "@box/blueprint-web";
|
|
2
|
+
import N from "lodash/get";
|
|
3
|
+
import { ItemTypeIcon as p } from "@box/item-icon";
|
|
4
4
|
import E from "clsx";
|
|
5
5
|
import { I as n } from "./types.js";
|
|
6
|
-
import { THUMBNAIL_LIST_VIEW_HEIGHTS as
|
|
7
|
-
import { jsxs as
|
|
8
|
-
import { ItemActionMenu as
|
|
9
|
-
import '../styles/index.css';const
|
|
10
|
-
tableHeaderActionsWrapper:
|
|
11
|
-
tableHeaderActions:
|
|
12
|
-
tableRow:
|
|
13
|
-
selectAllCheckbox:
|
|
14
|
-
tableNameCell:
|
|
15
|
-
tableNameCellSubtitle:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { THUMBNAIL_LIST_VIEW_HEIGHTS as y } from "../esm/lib/components/constants.js";
|
|
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_o1i04_1", w = "_tableHeaderActions_o1i04_1", U = "_tableRow_o1i04_33", k = "_selectAllCheckbox_o1i04_42", B = "_tableNameCell_o1i04_47", W = "_tableNameCellSubtitle_o1i04_53", j = "_tableNameCellIconInline_o1i04_58", F = "_infiniteScrollTableContainerFullHeight_o1i04_62", M = "_iconCell_o1i04_68", r = {
|
|
10
|
+
tableHeaderActionsWrapper: g,
|
|
11
|
+
tableHeaderActions: w,
|
|
12
|
+
tableRow: U,
|
|
13
|
+
selectAllCheckbox: k,
|
|
14
|
+
tableNameCell: B,
|
|
15
|
+
tableNameCellSubtitle: W,
|
|
16
|
+
tableNameCellIconInline: j,
|
|
17
|
+
infiniteScrollTableContainerFullHeight: F,
|
|
18
|
+
iconCell: M
|
|
19
|
+
}, K = ({
|
|
19
20
|
item: l,
|
|
20
21
|
columns: h,
|
|
21
22
|
iconColumnVariant: t,
|
|
22
23
|
isSelectAllEnabled: C,
|
|
23
|
-
itemActionMenuProps:
|
|
24
|
+
itemActionMenuProps: d,
|
|
24
25
|
zoomLevel: u = 0
|
|
25
|
-
}) => /* @__PURE__ */
|
|
26
|
-
className:
|
|
26
|
+
}) => /* @__PURE__ */ b(L, {
|
|
27
|
+
className: r.tableRow,
|
|
27
28
|
id: l.id,
|
|
28
|
-
children: [t === n.COLUMN ? /* @__PURE__ */ e(
|
|
29
|
+
children: [t === n.COLUMN ? /* @__PURE__ */ e(o, {
|
|
29
30
|
style: {
|
|
30
|
-
height:
|
|
31
|
+
height: y[u]
|
|
31
32
|
},
|
|
32
|
-
children: /* @__PURE__ */ e(
|
|
33
|
-
className:
|
|
33
|
+
children: /* @__PURE__ */ e(p, {
|
|
34
|
+
className: r.iconCell,
|
|
34
35
|
item: l
|
|
35
36
|
})
|
|
36
|
-
}, `item-type-icon-${l.id}`) : null, h.map((
|
|
37
|
+
}, `item-type-icon-${l.id}`) : null, h.map((a) => {
|
|
37
38
|
const {
|
|
38
39
|
cellRenderer: _,
|
|
39
|
-
id:
|
|
40
|
+
id: i,
|
|
40
41
|
isItemMetadata: T,
|
|
41
42
|
subtitle: f,
|
|
42
43
|
textValue: S,
|
|
43
44
|
type: H
|
|
44
|
-
} =
|
|
45
|
-
if (
|
|
46
|
-
return /* @__PURE__ */ e(
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
className:
|
|
49
|
-
children: [/* @__PURE__ */ e(
|
|
45
|
+
} = a, c = `${S}-${l.id}`, A = T ? i.split(".")[1] : i, I = N(l, A);
|
|
46
|
+
if (i === "name" && (t === n.INLINE || t === n.INLINE_SUBTITLE))
|
|
47
|
+
return /* @__PURE__ */ e(o, {
|
|
48
|
+
children: /* @__PURE__ */ b("div", {
|
|
49
|
+
className: r.tableNameCell,
|
|
50
|
+
children: [/* @__PURE__ */ e(p, {
|
|
50
51
|
item: l
|
|
51
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ b("div", {
|
|
52
53
|
className: E({
|
|
53
|
-
[
|
|
54
|
+
[r.tableNameCellSubtitle]: t === n.INLINE_SUBTITLE
|
|
54
55
|
}),
|
|
55
56
|
children: [/* @__PURE__ */ e(s, {
|
|
56
57
|
as: "span",
|
|
57
|
-
children:
|
|
58
|
+
children: I
|
|
58
59
|
}), t === n.INLINE_SUBTITLE ? /* @__PURE__ */ e(s, {
|
|
59
60
|
as: "span",
|
|
60
61
|
color: "textOnLightSecondary",
|
|
@@ -64,30 +65,30 @@ import '../styles/index.css';const y = "_tableHeaderActionsWrapper_zlqta_1", R =
|
|
|
64
65
|
})
|
|
65
66
|
}, c);
|
|
66
67
|
if (_)
|
|
67
|
-
return /* @__PURE__ */ e(
|
|
68
|
-
children: _(l,
|
|
68
|
+
return /* @__PURE__ */ e(o, {
|
|
69
|
+
children: _(l, a)
|
|
69
70
|
}, c);
|
|
70
71
|
if (H === "multiSelect") {
|
|
71
|
-
const
|
|
72
|
-
return /* @__PURE__ */ e(
|
|
73
|
-
children:
|
|
72
|
+
const m = N(l, i);
|
|
73
|
+
return /* @__PURE__ */ e(o, {
|
|
74
|
+
children: m ? m.join(" ") : ""
|
|
74
75
|
}, c);
|
|
75
76
|
}
|
|
76
|
-
return /* @__PURE__ */ e(
|
|
77
|
+
return /* @__PURE__ */ e(o, {
|
|
77
78
|
children: /* @__PURE__ */ e(s, {
|
|
78
79
|
as: "span",
|
|
79
|
-
children:
|
|
80
|
+
children: I
|
|
80
81
|
})
|
|
81
82
|
}, c);
|
|
82
83
|
}), C && /* @__PURE__ */ e(x, {
|
|
83
|
-
children: (
|
|
84
|
-
...
|
|
84
|
+
children: (a) => d ? /* @__PURE__ */ e(R, {
|
|
85
|
+
...d,
|
|
85
86
|
item: l,
|
|
86
|
-
onOpenChange:
|
|
87
|
+
onOpenChange: a
|
|
87
88
|
}) : null
|
|
88
89
|
})]
|
|
89
90
|
}, l.id);
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
K as T,
|
|
93
|
+
r as s
|
|
93
94
|
};
|
|
@@ -17,7 +17,7 @@ import '../../../../styles/action-bar.css';const b = "_actionBar_dsa2b_1", A = "
|
|
|
17
17
|
isViewModeButtonDisabled: m,
|
|
18
18
|
onViewModeClick: d,
|
|
19
19
|
onZoomLevelChange: l,
|
|
20
|
-
|
|
20
|
+
sortableColumns: f,
|
|
21
21
|
sortDropdownProps: a,
|
|
22
22
|
viewMode: i,
|
|
23
23
|
zoomLevel: w,
|
|
@@ -37,7 +37,7 @@ import '../../../../styles/action-bar.css';const b = "_actionBar_dsa2b_1", A = "
|
|
|
37
37
|
className: t.additionalActions,
|
|
38
38
|
children: [a && /* @__PURE__ */ o(h, {
|
|
39
39
|
...a,
|
|
40
|
-
|
|
40
|
+
sortableColumns: f
|
|
41
41
|
}), (c || i === r.GRID) && /* @__PURE__ */ o(R, {
|
|
42
42
|
onZoomLevelChange: l,
|
|
43
43
|
zoomLevel: w
|
|
@@ -4,12 +4,12 @@ import { useIntl as T } from "react-intl";
|
|
|
4
4
|
import { V as p } from "../../../../chunks/types.js";
|
|
5
5
|
import { THUMBNAIL_GRID_VIEW_SIZES as E } from "../constants.js";
|
|
6
6
|
import b from "./messages.js";
|
|
7
|
-
import { jsx as e, jsxs as
|
|
8
|
-
import { ItemActionMenu as
|
|
9
|
-
import '../../../../styles/metadata-grid.css';const
|
|
10
|
-
itemThumbnail:
|
|
11
|
-
}, A = 188, G = 250, g = 8, x = 5, U = (
|
|
12
|
-
items:
|
|
7
|
+
import { jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
8
|
+
import { ItemActionMenu as f } from "../item-action-menu/item-action-menu.js";
|
|
9
|
+
import '../../../../styles/metadata-grid.css';const L = "_itemThumbnail_93ess_1", M = {
|
|
10
|
+
itemThumbnail: L
|
|
11
|
+
}, A = 188, G = 250, g = 8, x = 5, U = (r) => A + G * (g - r) / x, N = ({
|
|
12
|
+
items: r,
|
|
13
13
|
itemActionMenuProps: n,
|
|
14
14
|
zoomLevel: c,
|
|
15
15
|
...d
|
|
@@ -19,38 +19,38 @@ import '../../../../styles/metadata-grid.css';const f = "_itemThumbnail_93ess_1"
|
|
|
19
19
|
} = T();
|
|
20
20
|
return /* @__PURE__ */ e(i, {
|
|
21
21
|
"aria-label": _(b.gridView),
|
|
22
|
-
selectionMode: "multiple",
|
|
23
22
|
style: {
|
|
24
23
|
gridTemplateColumns: `repeat(auto-fit, minmax(${U(E[c])}px, 1fr))`
|
|
25
24
|
},
|
|
26
25
|
...d,
|
|
27
|
-
children:
|
|
28
|
-
var
|
|
26
|
+
children: r.map((t, D) => {
|
|
27
|
+
var o, a, l;
|
|
29
28
|
const {
|
|
30
|
-
name:
|
|
29
|
+
name: m,
|
|
31
30
|
createdAt: u
|
|
32
|
-
} = t,
|
|
33
|
-
return /* @__PURE__ */
|
|
31
|
+
} = t, s = "thumbnailURLs" in t ? ((o = t.thumbnailURLs) == null ? void 0 : o.large) || ((a = t.thumbnailURLs) == null ? void 0 : a.medium) || ((l = t.thumbnailURLs) == null ? void 0 : l.small) : void 0;
|
|
32
|
+
return /* @__PURE__ */ R(i.Item, {
|
|
33
|
+
textValue: m,
|
|
34
34
|
children: [/* @__PURE__ */ e(i.Thumbnail, {
|
|
35
|
-
className:
|
|
36
|
-
children:
|
|
37
|
-
alt:
|
|
38
|
-
src:
|
|
35
|
+
className: M.itemThumbnail,
|
|
36
|
+
children: s ? /* @__PURE__ */ e("img", {
|
|
37
|
+
alt: m,
|
|
38
|
+
src: s
|
|
39
39
|
}) : /* @__PURE__ */ e(h, {
|
|
40
40
|
item: t
|
|
41
41
|
})
|
|
42
42
|
}), /* @__PURE__ */ e(i.Header, {
|
|
43
|
-
children:
|
|
43
|
+
children: m
|
|
44
44
|
}), /* @__PURE__ */ e(i.Subtitle, {
|
|
45
45
|
children: u
|
|
46
|
-
}),
|
|
47
|
-
children: (I) => /* @__PURE__ */ e(
|
|
46
|
+
}), /* @__PURE__ */ e(i.Actions, {
|
|
47
|
+
children: n ? (I) => /* @__PURE__ */ e(f, {
|
|
48
48
|
...n,
|
|
49
49
|
item: t,
|
|
50
50
|
onOpenChange: I,
|
|
51
51
|
viewMode: p.GRID
|
|
52
|
-
})
|
|
53
|
-
})
|
|
52
|
+
}) : null
|
|
53
|
+
})]
|
|
54
54
|
}, t.id);
|
|
55
55
|
})
|
|
56
56
|
});
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import { TableBody as C, Row as
|
|
2
|
-
import { ItemTypeIcon as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { I as
|
|
1
|
+
import { TableBody as C, Row as b, Cell as m, ActionCell as g, Text as p } from "@box/blueprint-web";
|
|
2
|
+
import { ItemTypeIcon as E } from "@box/item-icon";
|
|
3
|
+
import y from "clsx";
|
|
4
|
+
import L from "lodash/get";
|
|
5
|
+
import I from "react";
|
|
6
|
+
import { I as c } from "../../../../../chunks/types.js";
|
|
7
7
|
import { THUMBNAIL_LIST_VIEW_HEIGHTS as x } from "../../constants.js";
|
|
8
|
-
import { s as
|
|
9
|
-
import { jsx as r, jsxs as
|
|
8
|
+
import { s as N, T as R } from "../../../../../chunks/index.js";
|
|
9
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
import { InlineEditingCell as w } from "./inline-editing-cell/inline-editing-cell.js";
|
|
11
11
|
import { ItemActionMenu as B } from "../../item-action-menu/item-action-menu.js";
|
|
12
12
|
import { GhostTableRow as _ } from "./ghost-table-row/ghost-table-row.js";
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
},
|
|
13
|
+
const $ = (t, e, l) => {
|
|
14
|
+
const n = l ? e.split(".")[1] : e;
|
|
15
|
+
return L(t, n);
|
|
16
|
+
}, U = /* @__PURE__ */ I.memo(({
|
|
17
17
|
item: t,
|
|
18
18
|
column: e,
|
|
19
|
-
iconColumnVariant:
|
|
19
|
+
iconColumnVariant: l
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
|
-
id:
|
|
22
|
+
id: n,
|
|
23
23
|
isItemMetadata: s,
|
|
24
24
|
subtitle: i,
|
|
25
|
-
textValue:
|
|
26
|
-
} = e, d = `${
|
|
27
|
-
return /* @__PURE__ */ r(
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
className:
|
|
30
|
-
children: [/* @__PURE__ */ r(
|
|
25
|
+
textValue: h
|
|
26
|
+
} = e, d = `${h}-${t.id}`;
|
|
27
|
+
return /* @__PURE__ */ r(m, {
|
|
28
|
+
children: /* @__PURE__ */ u("div", {
|
|
29
|
+
className: N.tableNameCell,
|
|
30
|
+
children: [/* @__PURE__ */ r(E, {
|
|
31
|
+
className: y({
|
|
32
|
+
[N.tableNameCellIconInline]: [c.INLINE_SUBTITLE, c.INLINE].includes(l)
|
|
33
|
+
}),
|
|
31
34
|
item: t
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
-
className:
|
|
34
|
-
[
|
|
35
|
+
}), /* @__PURE__ */ u("div", {
|
|
36
|
+
className: y({
|
|
37
|
+
[N.tableNameCellSubtitle]: l === c.INLINE_SUBTITLE
|
|
35
38
|
}),
|
|
36
|
-
children: [/* @__PURE__ */ r(
|
|
39
|
+
children: [/* @__PURE__ */ r(p, {
|
|
37
40
|
as: "span",
|
|
38
|
-
children:
|
|
39
|
-
}),
|
|
41
|
+
children: $(t, n, s)
|
|
42
|
+
}), l === c.INLINE_SUBTITLE && /* @__PURE__ */ r(p, {
|
|
40
43
|
as: "span",
|
|
41
44
|
color: "textOnLightSecondary",
|
|
42
45
|
children: i
|
|
@@ -44,108 +47,108 @@ const E = (t, e, n) => {
|
|
|
44
47
|
})]
|
|
45
48
|
})
|
|
46
49
|
}, d);
|
|
47
|
-
}),
|
|
50
|
+
}), k = /* @__PURE__ */ I.memo(({
|
|
48
51
|
item: t,
|
|
49
52
|
column: e
|
|
50
53
|
}) => {
|
|
51
|
-
var
|
|
52
|
-
const
|
|
53
|
-
return /* @__PURE__ */ r(
|
|
54
|
-
children: (
|
|
55
|
-
},
|
|
56
|
-
}),
|
|
54
|
+
var n;
|
|
55
|
+
const l = `${e.textValue}-${t.id}`;
|
|
56
|
+
return /* @__PURE__ */ r(m, {
|
|
57
|
+
children: (n = e.cellRenderer) == null ? void 0 : n.call(e, t, e)
|
|
58
|
+
}, l);
|
|
59
|
+
}), M = /* @__PURE__ */ I.memo(({
|
|
57
60
|
item: t,
|
|
58
61
|
column: e
|
|
59
62
|
}) => {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
children:
|
|
63
|
-
},
|
|
64
|
-
}), W = /* @__PURE__ */
|
|
63
|
+
const l = `${e.textValue}-${t.id}`, n = L(t, e.id);
|
|
64
|
+
return n ? /* @__PURE__ */ r(m, {
|
|
65
|
+
children: n.join(" ")
|
|
66
|
+
}, l) : /* @__PURE__ */ r(m, {}, l);
|
|
67
|
+
}), W = /* @__PURE__ */ I.memo(({
|
|
65
68
|
item: t,
|
|
66
69
|
column: e
|
|
67
70
|
}) => {
|
|
68
71
|
const {
|
|
69
|
-
id:
|
|
70
|
-
isItemMetadata:
|
|
72
|
+
id: l,
|
|
73
|
+
isItemMetadata: n,
|
|
71
74
|
textValue: s
|
|
72
75
|
} = e, i = `${s}-${t.id}`;
|
|
73
|
-
return /* @__PURE__ */ r(
|
|
74
|
-
children: /* @__PURE__ */ r(
|
|
76
|
+
return /* @__PURE__ */ r(m, {
|
|
77
|
+
children: /* @__PURE__ */ r(p, {
|
|
75
78
|
as: "span",
|
|
76
|
-
children:
|
|
79
|
+
children: $(t, l, n)
|
|
77
80
|
})
|
|
78
81
|
}, i);
|
|
79
|
-
}), j = /* @__PURE__ */
|
|
82
|
+
}), j = /* @__PURE__ */ I.memo(({
|
|
80
83
|
item: t,
|
|
81
84
|
column: e,
|
|
82
|
-
iconColumnVariant:
|
|
83
|
-
onInlineEditChange:
|
|
85
|
+
iconColumnVariant: l,
|
|
86
|
+
onInlineEditChange: n
|
|
84
87
|
}) => {
|
|
85
88
|
const {
|
|
86
89
|
cellRenderer: s,
|
|
87
90
|
id: i,
|
|
88
|
-
isInlineEditingEnabled:
|
|
91
|
+
isInlineEditingEnabled: h,
|
|
89
92
|
type: d
|
|
90
93
|
} = e;
|
|
91
|
-
return i === "item.name" && (
|
|
94
|
+
return i === "item.name" && (l === c.INLINE || l === c.INLINE_SUBTITLE) ? /* @__PURE__ */ r(U, {
|
|
92
95
|
column: e,
|
|
93
|
-
iconColumnVariant:
|
|
96
|
+
iconColumnVariant: l,
|
|
94
97
|
item: t
|
|
95
|
-
}) : s ? /* @__PURE__ */ r(
|
|
98
|
+
}) : s ? /* @__PURE__ */ r(k, {
|
|
96
99
|
column: e,
|
|
97
100
|
item: t
|
|
98
|
-
}) :
|
|
101
|
+
}) : h && (d === "multiSelect" || d === "enum") ? /* @__PURE__ */ r(w, {
|
|
99
102
|
column: e,
|
|
100
103
|
item: t,
|
|
101
|
-
onInlineEditChange:
|
|
102
|
-
}, `${e.id}-${t.id}`) : d === "multiSelect" ? /* @__PURE__ */ r(
|
|
104
|
+
onInlineEditChange: n
|
|
105
|
+
}, `${e.id}-${t.id}`) : d === "multiSelect" ? /* @__PURE__ */ r(M, {
|
|
103
106
|
column: e,
|
|
104
107
|
item: t
|
|
105
108
|
}) : /* @__PURE__ */ r(W, {
|
|
106
109
|
column: e,
|
|
107
110
|
item: t
|
|
108
111
|
});
|
|
109
|
-
}), D = /* @__PURE__ */
|
|
112
|
+
}), D = /* @__PURE__ */ I.memo(({
|
|
110
113
|
item: t,
|
|
111
114
|
zoomLevel: e
|
|
112
|
-
}) => /* @__PURE__ */ r(
|
|
115
|
+
}) => /* @__PURE__ */ r(m, {
|
|
113
116
|
style: {
|
|
114
117
|
height: x[e]
|
|
115
118
|
},
|
|
116
|
-
children: /* @__PURE__ */ r(
|
|
117
|
-
className:
|
|
119
|
+
children: /* @__PURE__ */ r(E, {
|
|
120
|
+
className: N.iconCell,
|
|
118
121
|
item: t
|
|
119
122
|
})
|
|
120
|
-
}, `item-type-icon-${t.id}`)), G = /* @__PURE__ */
|
|
123
|
+
}, `item-type-icon-${t.id}`)), G = /* @__PURE__ */ I.memo(({
|
|
121
124
|
item: t,
|
|
122
125
|
itemActionMenuProps: e
|
|
123
|
-
}) => /* @__PURE__ */ r(
|
|
124
|
-
children: (
|
|
126
|
+
}) => /* @__PURE__ */ r(g, {
|
|
127
|
+
children: (l) => e ? /* @__PURE__ */ r(B, {
|
|
125
128
|
...e,
|
|
126
129
|
item: t,
|
|
127
|
-
onOpenChange:
|
|
130
|
+
onOpenChange: l
|
|
128
131
|
}) : null
|
|
129
132
|
})), Z = ({
|
|
130
133
|
columns: t,
|
|
131
134
|
iconColumnVariant: e,
|
|
132
|
-
isSelectAllEnabled:
|
|
133
|
-
items:
|
|
135
|
+
isSelectAllEnabled: l,
|
|
136
|
+
items: n,
|
|
134
137
|
itemActionMenuProps: s,
|
|
135
138
|
virtualItems: i,
|
|
136
|
-
columnCount:
|
|
139
|
+
columnCount: h,
|
|
137
140
|
zoomLevel: d,
|
|
138
141
|
onInlineEditChange: T
|
|
139
142
|
}) => {
|
|
140
|
-
const
|
|
143
|
+
const S = e === c.COLUMN;
|
|
141
144
|
if (i) {
|
|
142
145
|
const o = (a) => /* @__PURE__ */ r(_, {
|
|
143
|
-
columnLength:
|
|
146
|
+
columnLength: h || 0,
|
|
144
147
|
rowKey: `ghost-${a}`
|
|
145
148
|
}), f = (a) => /* @__PURE__ */ r(R, {
|
|
146
149
|
columns: t,
|
|
147
150
|
iconColumnVariant: e,
|
|
148
|
-
isSelectAllEnabled:
|
|
151
|
+
isSelectAllEnabled: l,
|
|
149
152
|
item: a,
|
|
150
153
|
itemActionMenuProps: s,
|
|
151
154
|
zoomLevel: d
|
|
@@ -154,18 +157,18 @@ const E = (t, e, n) => {
|
|
|
154
157
|
items: i,
|
|
155
158
|
children: ({
|
|
156
159
|
index: a
|
|
157
|
-
}) => a >=
|
|
160
|
+
}) => a >= n.length ? o(a) : f(n[a])
|
|
158
161
|
});
|
|
159
162
|
}
|
|
160
163
|
return /* @__PURE__ */ r(C, {
|
|
161
|
-
items:
|
|
164
|
+
items: n.map((o) => ({
|
|
162
165
|
key: o.id,
|
|
163
166
|
...o
|
|
164
167
|
})),
|
|
165
|
-
children: (o) => /* @__PURE__ */
|
|
166
|
-
className:
|
|
168
|
+
children: (o) => /* @__PURE__ */ u(b, {
|
|
169
|
+
className: N.tableRow,
|
|
167
170
|
id: o.id,
|
|
168
|
-
children: [
|
|
171
|
+
children: [S && /* @__PURE__ */ r(D, {
|
|
169
172
|
item: o,
|
|
170
173
|
zoomLevel: d
|
|
171
174
|
}), t.map((f) => /* @__PURE__ */ r(j, {
|
|
@@ -173,7 +176,7 @@ const E = (t, e, n) => {
|
|
|
173
176
|
iconColumnVariant: e,
|
|
174
177
|
item: o,
|
|
175
178
|
onInlineEditChange: T
|
|
176
|
-
}, `${f.textValue}-${o.id}`)),
|
|
179
|
+
}, `${f.textValue}-${o.id}`)), l && /* @__PURE__ */ r(G, {
|
|
177
180
|
item: o,
|
|
178
181
|
itemActionMenuProps: s
|
|
179
182
|
})]
|
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
import { Table as T } from "@box/blueprint-web";
|
|
2
|
-
import { I as
|
|
3
|
-
import { GhostTableBody as
|
|
4
|
-
import
|
|
2
|
+
import { I as x } from "../../../../chunks/types.js";
|
|
3
|
+
import { GhostTableBody as B } from "./table-body/ghost-table-body.js";
|
|
4
|
+
import d from "./table-body/table-body-with-data.js";
|
|
5
5
|
import j from "./messages.js";
|
|
6
6
|
import { jsxs as y, jsx as i } from "react/jsx-runtime";
|
|
7
7
|
const O = ({
|
|
8
8
|
tableHeader: s,
|
|
9
9
|
columns: t,
|
|
10
|
-
iconColumnVariant:
|
|
10
|
+
iconColumnVariant: e,
|
|
11
11
|
isSelectAllEnabled: r,
|
|
12
12
|
itemActionMenuProps: c,
|
|
13
13
|
items: f,
|
|
14
|
-
isLoading:
|
|
14
|
+
isLoading: m,
|
|
15
15
|
formatMessage: h,
|
|
16
|
-
tableProps:
|
|
16
|
+
tableProps: C,
|
|
17
17
|
virtualItems: o,
|
|
18
|
-
style:
|
|
19
|
-
columnCount:
|
|
20
|
-
zoomLevel:
|
|
18
|
+
style: g,
|
|
19
|
+
columnCount: p,
|
|
20
|
+
zoomLevel: u,
|
|
21
21
|
onInlineEditChange: a
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
return
|
|
26
|
-
})(), b =
|
|
23
|
+
const l = p || (() => {
|
|
24
|
+
let n = t.length;
|
|
25
|
+
return e === x.COLUMN && (n += 1), r && (n += 1), n;
|
|
26
|
+
})(), b = m && !(o != null && o.length);
|
|
27
27
|
return /* @__PURE__ */ y(T, {
|
|
28
28
|
"aria-label": h(j.listView),
|
|
29
29
|
selectionBehavior: "toggle",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
columnCount: m,
|
|
30
|
+
style: g,
|
|
31
|
+
...C,
|
|
32
|
+
children: [s, b ? /* @__PURE__ */ i(B, {
|
|
33
|
+
columnLength: l
|
|
34
|
+
}) : /* @__PURE__ */ i(d, {
|
|
35
|
+
columnCount: l,
|
|
37
36
|
columns: t,
|
|
38
|
-
iconColumnVariant:
|
|
39
|
-
isLoading:
|
|
37
|
+
iconColumnVariant: e,
|
|
38
|
+
isLoading: m,
|
|
40
39
|
isSelectAllEnabled: r,
|
|
41
40
|
itemActionMenuProps: c,
|
|
42
41
|
items: f,
|
|
43
42
|
onInlineEditChange: a,
|
|
44
43
|
virtualItems: o,
|
|
45
|
-
zoomLevel:
|
|
44
|
+
zoomLevel: u
|
|
46
45
|
})]
|
|
47
46
|
});
|
|
48
47
|
};
|
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
import { DropdownMenu as
|
|
2
|
-
import { ArrowUp as
|
|
1
|
+
import { DropdownMenu as e, TriggerButton as w } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowUp as h, ArrowDown as D } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
3
|
import { useState as s } from "react";
|
|
4
|
-
import { jsxs as
|
|
4
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
5
5
|
const S = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
initialSortDirection:
|
|
9
|
-
onSortChange:
|
|
6
|
+
sortableColumns: o,
|
|
7
|
+
initialSortByColumnId: p = o[0].id,
|
|
8
|
+
initialSortDirection: m = "ascending",
|
|
9
|
+
onSortChange: a
|
|
10
10
|
}) => {
|
|
11
|
-
const [
|
|
12
|
-
if (n ===
|
|
13
|
-
const
|
|
14
|
-
|
|
11
|
+
const d = new Map(o.map((n) => [n.id, n.textValue])), [t, g] = s(m), [c, u] = s(p), l = (n) => {
|
|
12
|
+
if (n === c) {
|
|
13
|
+
const i = t === "ascending" ? "descending" : "ascending";
|
|
14
|
+
g(i), a({
|
|
15
|
+
column: n,
|
|
16
|
+
direction: i
|
|
17
|
+
});
|
|
15
18
|
} else
|
|
16
|
-
|
|
19
|
+
u(n), g("ascending"), a({
|
|
20
|
+
column: n,
|
|
21
|
+
direction: "ascending"
|
|
22
|
+
});
|
|
17
23
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
children: [/* @__PURE__ */
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
caretDirection:
|
|
22
|
-
label:
|
|
23
|
-
startIcon:
|
|
24
|
+
return /* @__PURE__ */ f(e.Root, {
|
|
25
|
+
children: [/* @__PURE__ */ r(e.Trigger, {
|
|
26
|
+
children: /* @__PURE__ */ r(w, {
|
|
27
|
+
caretDirection: t === "ascending" ? "up" : "down",
|
|
28
|
+
label: d.get(c),
|
|
29
|
+
startIcon: t === "ascending" ? h : D,
|
|
24
30
|
variant: "tertiary"
|
|
25
31
|
})
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
onValueChange:
|
|
29
|
-
value:
|
|
30
|
-
children:
|
|
32
|
+
}), /* @__PURE__ */ r(e.Content, {
|
|
33
|
+
children: /* @__PURE__ */ r(e.RadioGroup, {
|
|
34
|
+
onValueChange: l,
|
|
35
|
+
value: d.get(c),
|
|
36
|
+
children: o.map(({
|
|
37
|
+
id: n,
|
|
38
|
+
textValue: i
|
|
39
|
+
}) => /* @__PURE__ */ r(e.RadioSelectItem, {
|
|
31
40
|
value: n,
|
|
32
|
-
children:
|
|
41
|
+
children: i
|
|
33
42
|
}, n))
|
|
34
43
|
})
|
|
35
44
|
})]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as
|
|
2
|
-
import { ActionBar as
|
|
1
|
+
import { I as R, V as t } from "../../chunks/types.js";
|
|
2
|
+
import { ActionBar as g } from "./components/action-bar/action-bar.js";
|
|
3
3
|
import "./components/filter-row/filter-row.js";
|
|
4
4
|
import "../../chunks/form-filter-chip.js";
|
|
5
5
|
import "./components/filter-row/metadata-filter-chip.js";
|
|
@@ -8,8 +8,8 @@ import "./components/filter-row/predefinedFilters/index.js";
|
|
|
8
8
|
import "./components/filter-sidepanel/filter.js";
|
|
9
9
|
import "./components/filter-sidepanel/filter-side-panel.js";
|
|
10
10
|
import "./components/item-action-menu/item-action-menu.js";
|
|
11
|
-
import { MetadataGrid as
|
|
12
|
-
import { MetadataTable as
|
|
11
|
+
import { MetadataGrid as k } from "./components/metadata-grid/metadata-grid.js";
|
|
12
|
+
import { MetadataTable as x } from "./components/metadata-table/metadata-table.js";
|
|
13
13
|
import "./components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js";
|
|
14
14
|
import "./components/metadata-table/table-renderer.js";
|
|
15
15
|
import "./components/metadata-value/metadata-file-chip.js";
|
|
@@ -17,84 +17,88 @@ import "./components/metadata-value/metadata-file-field.js";
|
|
|
17
17
|
import "./components/metadata-value/metadata-location-field.js";
|
|
18
18
|
import "./components/metadata-value/metadata-radio-field.js";
|
|
19
19
|
import "./components/metadata-value/metadata-search-field.js";
|
|
20
|
-
import { Pagination as
|
|
20
|
+
import { Pagination as D } from "./components/pagination/pagination.js";
|
|
21
21
|
import "./components/pagination/marker-based-pagination.js";
|
|
22
22
|
import "./components/pagination/offset-based-pagination.js";
|
|
23
23
|
import "./components/pagination/pagination-controls.js";
|
|
24
24
|
import "./components/sort-dropdown/sort-dropdown.js";
|
|
25
|
-
import { SwitchCase as
|
|
26
|
-
import { TooltipProvider as
|
|
27
|
-
import { useState as
|
|
28
|
-
import { jsx as
|
|
29
|
-
import { ErrorState as
|
|
30
|
-
import
|
|
31
|
-
import '../../styles/metadata-view.css';const Z = "_container_nykl3_5", z = "_contentContainer_nykl3_14",
|
|
25
|
+
import { SwitchCase as E, Case as a } from "./components/switch-case/switch-case.js";
|
|
26
|
+
import { TooltipProvider as G } from "@box/blueprint-web";
|
|
27
|
+
import { useState as u, useRef as N } from "react";
|
|
28
|
+
import { jsx as o, jsxs as M, Fragment as b } from "react/jsx-runtime";
|
|
29
|
+
import { ErrorState as j } from "./components/error-state/error-state.js";
|
|
30
|
+
import A from "./components/empty-state/empty-state.js";
|
|
31
|
+
import '../../styles/metadata-view.css';const Z = "_container_nykl3_5", z = "_contentContainer_nykl3_14", I = {
|
|
32
32
|
container: Z,
|
|
33
33
|
contentContainer: z
|
|
34
34
|
};
|
|
35
|
-
function
|
|
36
|
-
actionBarProps:
|
|
35
|
+
function Mo({
|
|
36
|
+
actionBarProps: n,
|
|
37
37
|
columns: c,
|
|
38
|
-
tableProps:
|
|
39
|
-
hasError:
|
|
38
|
+
tableProps: l,
|
|
39
|
+
hasError: w,
|
|
40
40
|
onRefresh: S,
|
|
41
|
-
initialViewMode: V =
|
|
42
|
-
paginationProps:
|
|
41
|
+
initialViewMode: V = t.LIST,
|
|
42
|
+
paginationProps: p,
|
|
43
43
|
isLoading: s,
|
|
44
|
+
isSelectionEnabled: i,
|
|
44
45
|
...r
|
|
45
46
|
}) {
|
|
46
|
-
const [e, d] =
|
|
47
|
-
e ===
|
|
48
|
-
},
|
|
47
|
+
const [e, d] = u(V), [m, v] = u(0), f = N(null), y = () => {
|
|
48
|
+
e === t.LIST ? d(t.GRID) : d(t.LIST);
|
|
49
|
+
}, L = !s && r.items.length === 0, T = n && n.sortDropdownProps && c.filter((h) => h.type !== "multiSelect" && h.type !== "enum"), {
|
|
49
50
|
iconColumnVariant: C
|
|
50
|
-
} =
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
children: /* @__PURE__ */
|
|
51
|
+
} = l || {}, _ = C && C === R.COLUMN;
|
|
52
|
+
return /* @__PURE__ */ o(G, {
|
|
53
|
+
children: /* @__PURE__ */ o("div", {
|
|
53
54
|
ref: f,
|
|
54
|
-
className:
|
|
55
|
-
children:
|
|
55
|
+
className: I.container,
|
|
56
|
+
children: w ? /* @__PURE__ */ o(j, {
|
|
56
57
|
onRefresh: S
|
|
57
|
-
}) : /* @__PURE__ */
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
...
|
|
58
|
+
}) : /* @__PURE__ */ M(b, {
|
|
59
|
+
children: [/* @__PURE__ */ o(g, {
|
|
60
|
+
...n,
|
|
60
61
|
containerRef: f,
|
|
61
|
-
isIconColumnEnabled:
|
|
62
|
-
onViewModeClick:
|
|
63
|
-
onZoomLevelChange:
|
|
64
|
-
|
|
62
|
+
isIconColumnEnabled: _,
|
|
63
|
+
onViewModeClick: y,
|
|
64
|
+
onZoomLevelChange: v,
|
|
65
|
+
sortableColumns: T,
|
|
65
66
|
viewMode: e,
|
|
66
67
|
zoomLevel: m
|
|
67
|
-
}), /* @__PURE__ */
|
|
68
|
-
className:
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
condition:
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
}), /* @__PURE__ */
|
|
74
|
-
condition: e ===
|
|
75
|
-
children: /* @__PURE__ */
|
|
68
|
+
}), /* @__PURE__ */ o("div", {
|
|
69
|
+
className: I.contentContainer,
|
|
70
|
+
children: /* @__PURE__ */ M(E, {
|
|
71
|
+
children: [/* @__PURE__ */ o(a, {
|
|
72
|
+
condition: L,
|
|
73
|
+
children: /* @__PURE__ */ o(A, {})
|
|
74
|
+
}), /* @__PURE__ */ o(a, {
|
|
75
|
+
condition: e === t.LIST,
|
|
76
|
+
children: /* @__PURE__ */ o(x, {
|
|
76
77
|
columns: c,
|
|
77
78
|
isLoading: s,
|
|
79
|
+
isSelectAllEnabled: i,
|
|
80
|
+
selectionMode: i ? "multiple" : "none",
|
|
78
81
|
zoomLevel: m,
|
|
79
82
|
...r,
|
|
80
|
-
...
|
|
83
|
+
...l
|
|
81
84
|
})
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
condition: e ===
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ o(a, {
|
|
86
|
+
condition: e === t.GRID,
|
|
87
|
+
children: /* @__PURE__ */ o(k, {
|
|
88
|
+
selectionMode: i ? "multiple" : "none",
|
|
85
89
|
zoomLevel: m,
|
|
86
90
|
...r
|
|
87
91
|
})
|
|
88
92
|
})]
|
|
89
93
|
})
|
|
90
|
-
}),
|
|
91
|
-
...
|
|
94
|
+
}), p && /* @__PURE__ */ o(D, {
|
|
95
|
+
...p
|
|
92
96
|
})]
|
|
93
97
|
})
|
|
94
98
|
})
|
|
95
99
|
});
|
|
96
100
|
}
|
|
97
101
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
Mo as MetadataView,
|
|
103
|
+
Mo as default
|
|
100
104
|
};
|
package/dist/styles/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tableHeaderActionsWrapper_o1i04_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_o1i04_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_o1i04_1{position:sticky;right:0;width:var(--size-6);padding:0}._tableRow_o1i04_33:after{height:100%!important}._tableRow_o1i04_33[aria-selected=true]:after{height:100%!important}._selectAllCheckbox_o1i04_42 svg{transform:none!important}._tableNameCell_o1i04_47{display:flex;gap:var(--space-3);align-items:center}._tableNameCellSubtitle_o1i04_53{display:flex;flex-direction:column}._tableNameCellIconInline_o1i04_58{min-width:var(--size-8)}._infiniteScrollTableContainerFullHeight_o1i04_62{width:100%;height:100%;overflow:auto}._iconCell_o1i04_68{width:100%!important;height:100%!important}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewMode } from '../../types';
|
|
1
|
+
import { Column, ViewMode } from '../../types';
|
|
2
2
|
import { FilterRowProps } from '../filter-row';
|
|
3
3
|
import { SortDropdownProps } from '../sort-dropdown';
|
|
4
4
|
import { FilterGroup } from '../filter-row/types';
|
|
@@ -13,7 +13,7 @@ export interface ActionBarProps extends Omit<FilterRowProps, 'filterGroups'> {
|
|
|
13
13
|
zoomLevel?: number;
|
|
14
14
|
}
|
|
15
15
|
interface ActionBarInternalProps extends ActionBarProps {
|
|
16
|
-
|
|
16
|
+
sortableColumns: Column[];
|
|
17
17
|
}
|
|
18
|
-
export declare const ActionBar: ({ isIconColumnEnabled, isViewModeButtonDisabled, onViewModeClick, onZoomLevelChange,
|
|
18
|
+
export declare const ActionBar: ({ isIconColumnEnabled, isViewModeButtonDisabled, onViewModeClick, onZoomLevelChange, sortableColumns, sortDropdownProps, viewMode, zoomLevel, ...rest }: ActionBarInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { SortDirection } from 'react-aria-components';
|
|
1
|
+
import { SortDescriptor, SortDirection } from 'react-aria-components';
|
|
2
|
+
import { Column } from '../../types';
|
|
2
3
|
export interface SortDropdownProps {
|
|
3
|
-
|
|
4
|
+
initialSortByColumnId?: string;
|
|
4
5
|
initialSortDirection?: SortDirection;
|
|
5
|
-
onSortChange: (
|
|
6
|
+
onSortChange: (sortDescriptor: SortDescriptor) => void;
|
|
6
7
|
}
|
|
7
8
|
interface SortDropdownInternalProps extends SortDropdownProps {
|
|
8
|
-
|
|
9
|
+
sortableColumns: Column[];
|
|
9
10
|
}
|
|
10
|
-
export declare const SortDropdown: ({
|
|
11
|
+
export declare const SortDropdown: ({ sortableColumns, initialSortByColumnId, initialSortDirection, onSortChange, }: SortDropdownInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Selection } from 'react-aria-components';
|
|
1
2
|
import { ActionBarProps, MetadataTableProps, PaginationProps } from './components';
|
|
2
3
|
import { ViewMode, Column, MetadataProps } from './types';
|
|
3
4
|
export interface MetadataViewProps extends MetadataProps {
|
|
@@ -6,8 +7,11 @@ export interface MetadataViewProps extends MetadataProps {
|
|
|
6
7
|
hasError?: boolean;
|
|
7
8
|
initialViewMode?: ViewMode;
|
|
8
9
|
onRefresh?: () => void;
|
|
9
|
-
|
|
10
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
11
|
+
selectedKeys?: 'all' | Iterable<string | number>;
|
|
12
|
+
isSelectionEnabled?: boolean;
|
|
13
|
+
tableProps?: Omit<MetadataTableProps, 'columns' | 'isSelectAllEnabled' | 'items' | 'itemActionMenuProps' | 'onSelectionChange' | 'selectedKeys'>;
|
|
10
14
|
paginationProps?: PaginationProps;
|
|
11
15
|
}
|
|
12
|
-
export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, onRefresh, initialViewMode, paginationProps, isLoading, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, onRefresh, initialViewMode, paginationProps, isLoading, isSelectionEnabled, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
17
|
export default MetadataView;
|
|
@@ -23,7 +23,7 @@ export declare const mockFilterOptionsWithInvalidType: FilterOption[];
|
|
|
23
23
|
export declare const mockFilterOptionsWithSomeChipsHidden: FilterOption[];
|
|
24
24
|
export declare const mockMetadata: Item[];
|
|
25
25
|
export declare const mockMetadataWithThumbnail: Item[];
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const mockSortableColumns: Column[];
|
|
27
27
|
export declare const mockSortDropdownProps: SortDropdownProps;
|
|
28
28
|
export declare const mockFilterGroups: FilterGroup[];
|
|
29
29
|
export declare const mockTypedPaginationPropsMarker: PaginationProps;
|