@box/metadata-view 1.33.1 → 1.33.3
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,16 +1,16 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { useInfiniteScrollTableItems as
|
|
1
|
+
import { useRef as O } from "react";
|
|
2
|
+
import { useIntl as Z } from "react-intl";
|
|
3
|
+
import { Text as _, ListCheckbox as q, DataTableWrapper as E, TableHeader as F, Column as G } from "@box/blueprint-web";
|
|
4
|
+
import { useInfiniteScrollTableItems as J } from "./hooks/useInfiniteScrollTableItems.js";
|
|
5
5
|
import { TableRenderer as R } from "./table-renderer.js";
|
|
6
|
-
import { I as
|
|
7
|
-
import { THUMBNAIL_WIDTHS as
|
|
6
|
+
import { I as K } from "../../../../chunks/types.js";
|
|
7
|
+
import { THUMBNAIL_WIDTHS as Q } from "../constants.js";
|
|
8
8
|
import { s as i } from "../../../../chunks/index.js";
|
|
9
|
-
import { getShouldRenderActionColumn as
|
|
10
|
-
import
|
|
11
|
-
import { jsx as t, jsxs as
|
|
9
|
+
import { getShouldRenderActionColumn as X } from "./actionColumn.js";
|
|
10
|
+
import Y from "./messages.js";
|
|
11
|
+
import { jsx as t, jsxs as $ } from "react/jsx-runtime";
|
|
12
12
|
import "./table-body/inline-editing-cell/inline-editing-cell.js";
|
|
13
|
-
const
|
|
13
|
+
const me = ({
|
|
14
14
|
areSelectionCheckboxesDisabled: n = !1,
|
|
15
15
|
columns: m,
|
|
16
16
|
hasNextPage: b = !1,
|
|
@@ -18,33 +18,33 @@ const ie = ({
|
|
|
18
18
|
isInfiniteScrollEnabled: T = !1,
|
|
19
19
|
isLoading: s = !1,
|
|
20
20
|
isSelectAllEnabled: W,
|
|
21
|
-
itemActionMenuProps:
|
|
21
|
+
itemActionMenuProps: w,
|
|
22
22
|
items: c,
|
|
23
|
-
maxActionColumnWidth:
|
|
24
|
-
minActionColumnWidth:
|
|
25
|
-
onGetNextPage:
|
|
26
|
-
onInlineEditChange:
|
|
27
|
-
onTableRowClick:
|
|
28
|
-
placeholderRowsCount:
|
|
23
|
+
maxActionColumnWidth: x,
|
|
24
|
+
minActionColumnWidth: A,
|
|
25
|
+
onGetNextPage: S,
|
|
26
|
+
onInlineEditChange: g,
|
|
27
|
+
onTableRowClick: C,
|
|
28
|
+
placeholderRowsCount: N,
|
|
29
29
|
zoomLevel: a,
|
|
30
30
|
...l
|
|
31
31
|
}) => {
|
|
32
32
|
const {
|
|
33
33
|
formatMessage: f
|
|
34
|
-
} =
|
|
34
|
+
} = Z(), u = O(null), {
|
|
35
35
|
virtualItemsToDisplay: y,
|
|
36
36
|
totalVirtualSize: D
|
|
37
|
-
} =
|
|
37
|
+
} = J({
|
|
38
38
|
items: c,
|
|
39
39
|
hasNextPage: b,
|
|
40
40
|
isLoading: s,
|
|
41
|
-
parentRef:
|
|
42
|
-
onGetNextPage:
|
|
43
|
-
placeholderRowsCount:
|
|
41
|
+
parentRef: u,
|
|
42
|
+
onGetNextPage: S,
|
|
43
|
+
placeholderRowsCount: N
|
|
44
44
|
}), r = [], M = 0;
|
|
45
|
-
if (d ===
|
|
45
|
+
if (d === K.COLUMN) {
|
|
46
46
|
a = a || M;
|
|
47
|
-
const e = parseInt(
|
|
47
|
+
const e = parseInt(Q[a], 10) + 24;
|
|
48
48
|
r.push({
|
|
49
49
|
id: "item-type-icon",
|
|
50
50
|
isRowHeader: !1,
|
|
@@ -60,27 +60,28 @@ const ie = ({
|
|
|
60
60
|
headerRenderer: H,
|
|
61
61
|
textValue: o,
|
|
62
62
|
type: I,
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
allowsSorting: k,
|
|
64
|
+
...v
|
|
65
|
+
} = e, B = I !== "multiSelect" && I !== "enum" && k === !0;
|
|
65
66
|
return {
|
|
66
|
-
...
|
|
67
|
-
children: H ? H(o, e) : /* @__PURE__ */ t(
|
|
67
|
+
...v,
|
|
68
|
+
children: H ? H(o, e) : /* @__PURE__ */ t(_, {
|
|
68
69
|
as: "span",
|
|
69
70
|
children: o
|
|
70
71
|
}),
|
|
71
72
|
isRowHeader: h === "name" || V,
|
|
72
73
|
id: h,
|
|
73
74
|
textValue: o,
|
|
74
|
-
allowsSorting:
|
|
75
|
+
allowsSorting: B
|
|
75
76
|
};
|
|
76
77
|
});
|
|
77
|
-
r.push(...j),
|
|
78
|
+
r.push(...j), X(l) && r.push({
|
|
78
79
|
id: "actions",
|
|
79
80
|
className: i.tableHeaderActions,
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ $("div", {
|
|
81
82
|
className: i.tableHeaderActionsWrapper,
|
|
82
|
-
children: [l.HeaderActions, W ? /* @__PURE__ */ t(
|
|
83
|
-
"aria-label": f(
|
|
83
|
+
children: [l.HeaderActions, W ? /* @__PURE__ */ t(q, {
|
|
84
|
+
"aria-label": f(Y.selectAll),
|
|
84
85
|
className: i.selectAllCheckbox,
|
|
85
86
|
isDisabled: s || n
|
|
86
87
|
}) : null]
|
|
@@ -88,40 +89,40 @@ const ie = ({
|
|
|
88
89
|
isRowHeader: !1,
|
|
89
90
|
hideHeader: !1,
|
|
90
91
|
allowsSorting: !1,
|
|
91
|
-
maxWidth:
|
|
92
|
-
minWidth:
|
|
92
|
+
maxWidth: x,
|
|
93
|
+
minWidth: A
|
|
93
94
|
});
|
|
94
|
-
const U = /* @__PURE__ */ t(
|
|
95
|
+
const U = /* @__PURE__ */ t(F, {
|
|
95
96
|
columns: r,
|
|
96
|
-
children: (e) => /* @__PURE__ */ t(
|
|
97
|
+
children: (e) => /* @__PURE__ */ t(G, {
|
|
97
98
|
...e
|
|
98
99
|
})
|
|
99
|
-
}),
|
|
100
|
+
}), p = {
|
|
100
101
|
columnCount: r.length,
|
|
101
102
|
columns: m,
|
|
102
103
|
formatMessage: f,
|
|
103
104
|
iconColumnVariant: d,
|
|
104
105
|
isLoading: s,
|
|
105
106
|
areSelectionCheckboxesDisabled: n,
|
|
106
|
-
itemActionMenuProps:
|
|
107
|
+
itemActionMenuProps: w,
|
|
107
108
|
items: c,
|
|
108
|
-
onInlineEditChange:
|
|
109
|
-
onTableRowClick:
|
|
109
|
+
onInlineEditChange: g,
|
|
110
|
+
onTableRowClick: C,
|
|
110
111
|
tableHeader: U,
|
|
111
112
|
tableProps: l,
|
|
112
113
|
zoomLevel: a
|
|
113
114
|
};
|
|
114
|
-
return T ? /* @__PURE__ */ t(
|
|
115
|
-
ref:
|
|
115
|
+
return T ? /* @__PURE__ */ t(E, {
|
|
116
|
+
ref: u,
|
|
116
117
|
children: /* @__PURE__ */ t(R, {
|
|
117
|
-
...
|
|
118
|
+
...p,
|
|
118
119
|
totalVirtualSize: D,
|
|
119
120
|
virtualItems: y
|
|
120
121
|
})
|
|
121
122
|
}) : /* @__PURE__ */ t(R, {
|
|
122
|
-
...
|
|
123
|
+
...p
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
export {
|
|
126
|
-
|
|
127
|
+
me as MetadataTable
|
|
127
128
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as
|
|
1
|
+
import { V as e, I as O } from "../../chunks/types.js";
|
|
2
2
|
import { ActionBar as Z } from "./components/action-bar/action-bar.js";
|
|
3
3
|
import "./components/filter-row/filter-row.js";
|
|
4
4
|
import "./components/filter-row/form-filter-chip.js";
|
|
@@ -25,7 +25,7 @@ import "./components/sort-dropdown/sort-dropdown.js";
|
|
|
25
25
|
import { SwitchCase as A, Case as c } from "./components/switch-case/switch-case.js";
|
|
26
26
|
import { TooltipProvider as F } from "@box/blueprint-web";
|
|
27
27
|
import { useState as p, useRef as U, useCallback as q } from "react";
|
|
28
|
-
import { jsx as o, jsxs as
|
|
28
|
+
import { jsx as o, jsxs as v, Fragment as H } from "react/jsx-runtime";
|
|
29
29
|
import { ErrorState as J } from "./components/error-state/error-state.js";
|
|
30
30
|
import K from "./components/empty-state/empty-state.js";
|
|
31
31
|
import '../../styles/metadata-view.css';const Q = "_container_1o9go_5", W = "_contentContainer_1o9go_15", T = {
|
|
@@ -38,7 +38,7 @@ function _o({
|
|
|
38
38
|
tableProps: i,
|
|
39
39
|
hasError: V,
|
|
40
40
|
onRefresh: L,
|
|
41
|
-
initialViewMode: _ =
|
|
41
|
+
initialViewMode: _ = e.LIST,
|
|
42
42
|
paginationProps: l,
|
|
43
43
|
isLoading: d,
|
|
44
44
|
isSelectAllEnabled: y = !0,
|
|
@@ -46,52 +46,52 @@ function _o({
|
|
|
46
46
|
areSelectionCheckboxesDisabled: h,
|
|
47
47
|
...m
|
|
48
48
|
}) {
|
|
49
|
-
const [n, f] = p(_), [
|
|
50
|
-
n ===
|
|
51
|
-
}, x = !d && m.items.length === 0, E = r && r.sortDropdownProps && s.filter((
|
|
52
|
-
iconColumnVariant:
|
|
53
|
-
} = i || {}, G =
|
|
54
|
-
column:
|
|
55
|
-
direction:
|
|
49
|
+
const [n, f] = p(_), [S, u] = p(void 0), [a, D] = p(0), g = U(null), R = () => {
|
|
50
|
+
n === e.LIST ? f(e.GRID) : f(e.LIST);
|
|
51
|
+
}, x = !d && m.items.length === 0, E = r && r.sortDropdownProps && s.filter((t) => t.type !== "multiSelect" && t.type !== "enum" && t.allowsSorting === !0), {
|
|
52
|
+
iconColumnVariant: M
|
|
53
|
+
} = i || {}, G = M && M === O.COLUMN, w = i?.onSortChange, N = q(({
|
|
54
|
+
column: t,
|
|
55
|
+
direction: I
|
|
56
56
|
}) => {
|
|
57
|
-
|
|
58
|
-
column:
|
|
59
|
-
direction:
|
|
60
|
-
}),
|
|
61
|
-
column:
|
|
62
|
-
direction:
|
|
57
|
+
u({
|
|
58
|
+
column: t,
|
|
59
|
+
direction: I
|
|
60
|
+
}), w?.({
|
|
61
|
+
column: t,
|
|
62
|
+
direction: I
|
|
63
63
|
});
|
|
64
|
-
}, [
|
|
64
|
+
}, [w]), j = {
|
|
65
65
|
...i,
|
|
66
|
-
sortDescriptor:
|
|
66
|
+
sortDescriptor: S,
|
|
67
67
|
onSortChange: N
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ o(F, {
|
|
70
70
|
children: /* @__PURE__ */ o("div", {
|
|
71
|
-
ref:
|
|
71
|
+
ref: g,
|
|
72
72
|
className: T.container,
|
|
73
73
|
children: V ? /* @__PURE__ */ o(J, {
|
|
74
74
|
onRefresh: L
|
|
75
|
-
}) : /* @__PURE__ */
|
|
75
|
+
}) : /* @__PURE__ */ v(H, {
|
|
76
76
|
children: [/* @__PURE__ */ o(Z, {
|
|
77
77
|
...r,
|
|
78
|
-
containerRef:
|
|
78
|
+
containerRef: g,
|
|
79
79
|
isIconColumnEnabled: G,
|
|
80
|
-
onSortDescriptorChange:
|
|
80
|
+
onSortDescriptorChange: u,
|
|
81
81
|
onViewModeClick: R,
|
|
82
82
|
onZoomLevelChange: D,
|
|
83
83
|
sortableColumns: E,
|
|
84
|
-
sortDescriptor:
|
|
84
|
+
sortDescriptor: S,
|
|
85
85
|
viewMode: n,
|
|
86
86
|
zoomLevel: a
|
|
87
87
|
}), /* @__PURE__ */ o("div", {
|
|
88
88
|
className: T.contentContainer,
|
|
89
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ v(A, {
|
|
90
90
|
children: [/* @__PURE__ */ o(c, {
|
|
91
91
|
condition: x,
|
|
92
92
|
children: /* @__PURE__ */ o(K, {})
|
|
93
93
|
}), /* @__PURE__ */ o(c, {
|
|
94
|
-
condition: n ===
|
|
94
|
+
condition: n === e.LIST,
|
|
95
95
|
children: /* @__PURE__ */ o(k, {
|
|
96
96
|
areSelectionCheckboxesDisabled: h,
|
|
97
97
|
columns: s,
|
|
@@ -103,7 +103,7 @@ function _o({
|
|
|
103
103
|
...j
|
|
104
104
|
})
|
|
105
105
|
}), /* @__PURE__ */ o(c, {
|
|
106
|
-
condition: n ===
|
|
106
|
+
condition: n === e.GRID,
|
|
107
107
|
children: /* @__PURE__ */ o(b, {
|
|
108
108
|
areSelectionCheckboxesDisabled: h,
|
|
109
109
|
selectionMode: C ? "multiple" : "none",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.33.
|
|
3
|
+
"version": "1.33.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^12.112.
|
|
7
|
-
"@box/blueprint-web-assets": "^4.91.
|
|
8
|
-
"@box/box-item-type-selector": "^1.22.
|
|
9
|
-
"@box/item-icon": "^2.13.
|
|
10
|
-
"@box/metadata-filter": "^1.59.
|
|
6
|
+
"@box/blueprint-web": "^12.112.2",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.91.2",
|
|
8
|
+
"@box/box-item-type-selector": "^1.22.2",
|
|
9
|
+
"@box/item-icon": "^2.13.2",
|
|
10
|
+
"@box/metadata-filter": "^1.59.2",
|
|
11
11
|
"@box/types": "0.2.1",
|
|
12
12
|
"@tanstack/react-virtual": "^3.10.8",
|
|
13
13
|
"formik": "^2.4.5",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"react-intl": "^6.4.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@box/blueprint-web": "^12.112.
|
|
22
|
-
"@box/blueprint-web-assets": "^4.91.
|
|
23
|
-
"@box/box-item-type-selector": "^1.22.
|
|
21
|
+
"@box/blueprint-web": "^12.112.2",
|
|
22
|
+
"@box/blueprint-web-assets": "^4.91.2",
|
|
23
|
+
"@box/box-item-type-selector": "^1.22.2",
|
|
24
24
|
"@box/eslint-plugin-blueprint": "1.0.5",
|
|
25
|
-
"@box/item-icon": "^2.13.
|
|
26
|
-
"@box/metadata-filter": "^1.59.
|
|
27
|
-
"@box/storybook-utils": "0.15.
|
|
25
|
+
"@box/item-icon": "^2.13.2",
|
|
26
|
+
"@box/metadata-filter": "^1.59.2",
|
|
27
|
+
"@box/storybook-utils": "0.15.2",
|
|
28
28
|
"@box/types": "2.0.0",
|
|
29
29
|
"@tanstack/react-virtual": "^3.10.8",
|
|
30
30
|
"react-intl": "^6.4.2"
|