@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.
- package/dist/chunks/table-row.js +52 -52
- package/dist/esm/lib/components/metadata-table/metadata-table.js +42 -40
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/index.js +4 -0
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js +37 -0
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +89 -95
- package/dist/esm/lib/components/metadata-table/table-renderer.js +17 -15
- package/dist/styles/inline-editing-cell.css +1 -0
- package/dist/styles/table-row.css +1 -1
- package/dist/types/lib/components/action-bar/action-bar.d.ts +1 -1
- package/dist/types/lib/components/metadata-table/metadata-table.d.ts +3 -1
- package/dist/types/lib/components/metadata-table/table-body/inline-editing-cell/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.d.ts +9 -0
- package/dist/types/lib/components/metadata-table/table-body/table-body-with-data.d.ts +12 -1
- package/dist/types/lib/components/metadata-table/table-renderer.d.ts +4 -2
- package/dist/types/lib/types.d.ts +2 -1
- package/package.json +2 -2
package/dist/chunks/table-row.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { Row as
|
|
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
|
|
4
|
-
import
|
|
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
|
|
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
|
|
9
|
-
import '../styles/table-row.css';const
|
|
10
|
-
tableHeaderActionsWrapper:
|
|
11
|
-
tableHeaderActions:
|
|
12
|
-
tableRow:
|
|
13
|
-
selectAllCheckbox:
|
|
14
|
-
tableNameCell:
|
|
15
|
-
|
|
16
|
-
infiniteScrollTableContainerFullHeight:
|
|
17
|
-
iconCell:
|
|
18
|
-
},
|
|
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:
|
|
20
|
+
columns: h,
|
|
21
21
|
iconColumnVariant: t,
|
|
22
|
-
isSelectAllEnabled:
|
|
22
|
+
isSelectAllEnabled: I,
|
|
23
23
|
itemActionMenuProps: d,
|
|
24
|
-
zoomLevel:
|
|
24
|
+
zoomLevel: u = 0
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */ _(
|
|
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(
|
|
30
|
+
children: [t === n.COLUMN ? /* @__PURE__ */ e(a, {
|
|
31
31
|
style: {
|
|
32
|
-
height:
|
|
32
|
+
height: x[C]
|
|
33
33
|
},
|
|
34
|
-
children: /* @__PURE__ */ e(
|
|
34
|
+
children: /* @__PURE__ */ e(p, {
|
|
35
35
|
className: i.iconCell,
|
|
36
36
|
item: l
|
|
37
37
|
})
|
|
38
|
-
}, `item-type-icon-${l.id}`) : null,
|
|
38
|
+
}, `item-type-icon-${l.id}`) : null, h.map((o) => {
|
|
39
39
|
const {
|
|
40
|
-
cellRenderer:
|
|
41
|
-
id:
|
|
42
|
-
|
|
40
|
+
cellRenderer: m,
|
|
41
|
+
id: r,
|
|
42
|
+
subtitle: T,
|
|
43
43
|
textValue: f,
|
|
44
|
-
type:
|
|
45
|
-
} = o,
|
|
46
|
-
if (
|
|
47
|
-
return /* @__PURE__ */ e(
|
|
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(
|
|
50
|
+
children: [/* @__PURE__ */ e(p, {
|
|
51
51
|
item: l
|
|
52
52
|
}), /* @__PURE__ */ _("div", {
|
|
53
|
-
className:
|
|
54
|
-
[i.
|
|
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,
|
|
58
|
+
children: b(l, r)
|
|
59
59
|
}), t === n.INLINE_SUBTITLE ? /* @__PURE__ */ e(s, {
|
|
60
60
|
as: "span",
|
|
61
61
|
color: "textOnLightSecondary",
|
|
62
|
-
children:
|
|
62
|
+
children: T
|
|
63
63
|
}) : null]
|
|
64
64
|
})]
|
|
65
65
|
})
|
|
66
|
-
},
|
|
67
|
-
if (
|
|
68
|
-
return /* @__PURE__ */ e(
|
|
69
|
-
children:
|
|
70
|
-
},
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */ e(
|
|
74
|
-
children:
|
|
75
|
-
},
|
|
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(
|
|
77
|
+
return /* @__PURE__ */ e(a, {
|
|
78
78
|
children: /* @__PURE__ */ e(s, {
|
|
79
79
|
as: "span",
|
|
80
|
-
children: b(l,
|
|
80
|
+
children: b(l, r)
|
|
81
81
|
})
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
children: (o) => d ? /* @__PURE__ */ e(
|
|
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
|
-
|
|
93
|
+
G as T,
|
|
94
94
|
i as s
|
|
95
95
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useInfiniteScrollTableItems as
|
|
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
|
|
7
|
-
import { THUMBNAIL_WIDTHS as
|
|
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
|
|
9
|
+
import j from "./messages.js";
|
|
10
10
|
import { jsx as e } from "react/jsx-runtime";
|
|
11
|
-
const
|
|
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
|
-
|
|
21
|
-
|
|
20
|
+
onInlineEditChange: C,
|
|
21
|
+
onGetNextPage: W,
|
|
22
|
+
placeholderRowsCount: g,
|
|
22
23
|
zoomLevel: r,
|
|
23
|
-
...
|
|
24
|
+
...w
|
|
24
25
|
}) => {
|
|
25
26
|
var u;
|
|
26
27
|
const {
|
|
27
28
|
formatMessage: c
|
|
28
|
-
} =
|
|
29
|
+
} = M(), f = v(null), {
|
|
29
30
|
virtualItemsToDisplay: p,
|
|
30
|
-
getTableHeight:
|
|
31
|
-
} =
|
|
31
|
+
getTableHeight: y
|
|
32
|
+
} = O({
|
|
32
33
|
items: m,
|
|
33
34
|
hasNextPage: x,
|
|
34
35
|
isLoading: l,
|
|
35
36
|
parentRef: f,
|
|
36
|
-
onGetNextPage:
|
|
37
|
-
placeholderRowsCount:
|
|
38
|
-
}), a = [],
|
|
39
|
-
if (n ===
|
|
40
|
-
r = r ||
|
|
41
|
-
const t = parseInt(
|
|
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
|
|
51
|
+
const N = o.map((t) => {
|
|
51
52
|
const {
|
|
52
53
|
id: H,
|
|
53
54
|
headerRenderer: b,
|
|
54
55
|
textValue: i,
|
|
55
|
-
...
|
|
56
|
+
..._
|
|
56
57
|
} = t;
|
|
57
58
|
return {
|
|
58
|
-
children: b ? b(i, t) : /* @__PURE__ */ e(
|
|
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
|
-
...
|
|
66
|
+
..._
|
|
66
67
|
};
|
|
67
68
|
});
|
|
68
|
-
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(
|
|
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
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
tableProps:
|
|
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:
|
|
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
|
-
|
|
130
|
+
Q as default
|
|
129
131
|
};
|
package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js
ADDED
|
@@ -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
|
|
2
|
-
import { ItemTypeIcon as
|
|
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
|
|
5
|
+
import i from "react";
|
|
6
6
|
import { I as h } from "../../../../../chunks/types.js";
|
|
7
|
-
import { THUMBNAIL_LIST_VIEW_HEIGHTS as
|
|
8
|
-
import
|
|
9
|
-
import { s as f, T as
|
|
10
|
-
import { jsx as r, jsxs as
|
|
11
|
-
import
|
|
12
|
-
|
|
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:
|
|
19
|
-
|
|
20
|
-
} = e,
|
|
21
|
-
return /* @__PURE__ */ r(
|
|
22
|
-
children: /* @__PURE__ */
|
|
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(
|
|
25
|
+
children: [/* @__PURE__ */ r($, {
|
|
25
26
|
item: t
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
+
}), /* @__PURE__ */ u("div", {
|
|
27
28
|
className: x({
|
|
28
|
-
[f.
|
|
29
|
+
[f.tableNameCellSubtitle]: n === h.INLINE_SUBTITLE
|
|
29
30
|
}),
|
|
30
|
-
children: [/* @__PURE__ */ r(
|
|
31
|
+
children: [/* @__PURE__ */ r(N, {
|
|
31
32
|
as: "span",
|
|
32
|
-
children: T(t,
|
|
33
|
-
}), n === h.INLINE_SUBTITLE && /* @__PURE__ */ r(
|
|
33
|
+
children: T(t, o)
|
|
34
|
+
}), n === h.INLINE_SUBTITLE && /* @__PURE__ */ r(N, {
|
|
34
35
|
as: "span",
|
|
35
36
|
color: "textOnLightSecondary",
|
|
36
|
-
children:
|
|
37
|
+
children: d
|
|
37
38
|
})]
|
|
38
39
|
})]
|
|
39
40
|
})
|
|
40
|
-
},
|
|
41
|
-
}), k = /* @__PURE__ */
|
|
41
|
+
}, a);
|
|
42
|
+
}), k = /* @__PURE__ */ i.memo(({
|
|
42
43
|
item: t,
|
|
43
44
|
column: e
|
|
44
45
|
}) => {
|
|
45
|
-
var
|
|
46
|
+
var o;
|
|
46
47
|
const n = `${e.textValue}-${t.id}`;
|
|
47
|
-
return /* @__PURE__ */ r(
|
|
48
|
-
children: (
|
|
48
|
+
return /* @__PURE__ */ r(c, {
|
|
49
|
+
children: (o = e.cellRenderer) == null ? void 0 : o.call(e, t, e)
|
|
49
50
|
}, n);
|
|
50
|
-
}),
|
|
51
|
+
}), U = /* @__PURE__ */ i.memo(({
|
|
51
52
|
item: t,
|
|
52
53
|
column: e
|
|
53
54
|
}) => {
|
|
54
|
-
const n = `${e.textValue}-${t.id}`,
|
|
55
|
-
return
|
|
56
|
-
children:
|
|
57
|
-
}, n) : /* @__PURE__ */ r(
|
|
58
|
-
}),
|
|
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(
|
|
64
|
-
children: /* @__PURE__ */ r(
|
|
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
|
-
}),
|
|
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:
|
|
77
|
+
cellRenderer: d,
|
|
87
78
|
id: a,
|
|
88
|
-
isInlineEditingEnabled:
|
|
79
|
+
isInlineEditingEnabled: p,
|
|
89
80
|
type: I
|
|
90
81
|
} = e;
|
|
91
|
-
return a === "name" && (n === h.INLINE || n === h.INLINE_SUBTITLE) ? /* @__PURE__ */ r(
|
|
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
|
-
}) :
|
|
86
|
+
}) : d ? /* @__PURE__ */ r(k, {
|
|
96
87
|
column: e,
|
|
97
88
|
item: t
|
|
98
|
-
}) : I === "multiSelect" ? /* @__PURE__ */ r(
|
|
89
|
+
}) : I === "multiSelect" ? /* @__PURE__ */ r(U, {
|
|
99
90
|
column: e,
|
|
100
91
|
item: t
|
|
101
|
-
}) :
|
|
92
|
+
}) : p && I === "enum" ? /* @__PURE__ */ r(w, {
|
|
102
93
|
column: e,
|
|
103
|
-
item: t
|
|
104
|
-
|
|
94
|
+
item: t,
|
|
95
|
+
onInlineEditChange: o
|
|
96
|
+
}) : /* @__PURE__ */ r(W, {
|
|
105
97
|
column: e,
|
|
106
98
|
item: t
|
|
107
99
|
});
|
|
108
|
-
}),
|
|
100
|
+
}), D = /* @__PURE__ */ i.memo(({
|
|
109
101
|
item: t,
|
|
110
102
|
zoomLevel: e
|
|
111
|
-
}) => /* @__PURE__ */ r(
|
|
103
|
+
}) => /* @__PURE__ */ r(c, {
|
|
112
104
|
style: {
|
|
113
|
-
height:
|
|
105
|
+
height: R[e]
|
|
114
106
|
},
|
|
115
|
-
children: /* @__PURE__ */ r(
|
|
107
|
+
children: /* @__PURE__ */ r($, {
|
|
116
108
|
className: f.iconCell,
|
|
117
109
|
item: t
|
|
118
110
|
})
|
|
119
|
-
}, `item-type-icon-${t.id}`)),
|
|
111
|
+
}, `item-type-icon-${t.id}`)), G = /* @__PURE__ */ i.memo(({
|
|
120
112
|
item: t,
|
|
121
113
|
itemActionMenuProps: e
|
|
122
|
-
}) => /* @__PURE__ */ r(
|
|
123
|
-
children: (n) => e ? /* @__PURE__ */ 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
|
-
})),
|
|
120
|
+
})), Y = ({
|
|
129
121
|
columns: t,
|
|
130
122
|
iconColumnVariant: e,
|
|
131
123
|
isSelectAllEnabled: n,
|
|
132
|
-
items:
|
|
133
|
-
itemActionMenuProps:
|
|
134
|
-
virtualItems:
|
|
135
|
-
columnCount:
|
|
136
|
-
zoomLevel:
|
|
124
|
+
items: o,
|
|
125
|
+
itemActionMenuProps: d,
|
|
126
|
+
virtualItems: a,
|
|
127
|
+
columnCount: p,
|
|
128
|
+
zoomLevel: I,
|
|
129
|
+
onInlineEditChange: C
|
|
137
130
|
}) => {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
columnLength:
|
|
142
|
-
rowKey: `ghost-${
|
|
143
|
-
}), m = (
|
|
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:
|
|
148
|
-
itemActionMenuProps:
|
|
149
|
-
zoomLevel:
|
|
140
|
+
item: s,
|
|
141
|
+
itemActionMenuProps: d,
|
|
142
|
+
zoomLevel: I
|
|
150
143
|
});
|
|
151
144
|
return /* @__PURE__ */ r(y, {
|
|
152
|
-
items:
|
|
145
|
+
items: a,
|
|
153
146
|
children: ({
|
|
154
|
-
index:
|
|
155
|
-
}) =>
|
|
147
|
+
index: s
|
|
148
|
+
}) => s >= o.length ? l(s) : m(o[s])
|
|
156
149
|
});
|
|
157
150
|
}
|
|
158
151
|
return /* @__PURE__ */ r(y, {
|
|
159
|
-
items:
|
|
160
|
-
key:
|
|
161
|
-
...
|
|
152
|
+
items: o.map((l) => ({
|
|
153
|
+
key: l.id,
|
|
154
|
+
...l
|
|
162
155
|
})),
|
|
163
|
-
children: (
|
|
156
|
+
children: (l) => /* @__PURE__ */ u(L, {
|
|
164
157
|
className: f.tableRow,
|
|
165
|
-
id:
|
|
166
|
-
children: [
|
|
167
|
-
item:
|
|
168
|
-
zoomLevel:
|
|
169
|
-
}), t.map((m) => /* @__PURE__ */ r(
|
|
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:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
item: l,
|
|
166
|
+
onInlineEditChange: C
|
|
167
|
+
}, `${m.textValue}-${l.id}`)), n && /* @__PURE__ */ r(G, {
|
|
168
|
+
item: l,
|
|
169
|
+
itemActionMenuProps: d
|
|
176
170
|
})]
|
|
177
|
-
},
|
|
171
|
+
}, l.id)
|
|
178
172
|
});
|
|
179
173
|
};
|
|
180
174
|
export {
|
|
181
|
-
|
|
175
|
+
Y as default
|
|
182
176
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Table as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { I as
|
|
5
|
-
import
|
|
6
|
-
import { jsxs as
|
|
7
|
-
const
|
|
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 ===
|
|
25
|
-
})(),
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
"aria-label": u(
|
|
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,
|
|
33
|
+
children: [s, b ? /* @__PURE__ */ i(d, {
|
|
33
34
|
columnLength: m
|
|
34
|
-
}) : /* @__PURE__ */ i(
|
|
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
|
-
|
|
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
|
-
.
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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",
|