@box/metadata-view 0.57.0 → 0.58.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,5 +1,5 @@
|
|
|
1
|
-
import { I as
|
|
2
|
-
import { ActionBar as
|
|
1
|
+
import { I as j, V as t } from "../../chunks/types.js";
|
|
2
|
+
import { ActionBar as k } 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";
|
|
5
5
|
import "./components/filter-row/metadata-filter-chip.js";
|
|
@@ -25,68 +25,68 @@ import "./components/sort-dropdown/sort-dropdown.js";
|
|
|
25
25
|
import { SwitchCase as z, Case as s } from "./components/switch-case/switch-case.js";
|
|
26
26
|
import { TooltipProvider as F } from "@box/blueprint-web";
|
|
27
27
|
import { useState as l, 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
|
-
import '../../styles/metadata-view.css';const O = "
|
|
31
|
+
import '../../styles/metadata-view.css';const O = "_container_1o9go_5", Q = "_contentContainer_1o9go_15", w = {
|
|
32
32
|
container: O,
|
|
33
33
|
contentContainer: Q
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function Vo({
|
|
36
36
|
actionBarProps: m,
|
|
37
37
|
columns: d,
|
|
38
38
|
tableProps: e,
|
|
39
|
-
hasError:
|
|
40
|
-
onRefresh:
|
|
41
|
-
initialViewMode:
|
|
39
|
+
hasError: T,
|
|
40
|
+
onRefresh: V,
|
|
41
|
+
initialViewMode: L = t.LIST,
|
|
42
42
|
paginationProps: C,
|
|
43
43
|
isLoading: f,
|
|
44
44
|
isSelectionEnabled: c,
|
|
45
45
|
...a
|
|
46
46
|
}) {
|
|
47
|
-
const [i, h] = l(
|
|
47
|
+
const [i, h] = l(L), [u, M] = l(void 0), [p, D] = l(0), S = U(null), _ = () => {
|
|
48
48
|
i === t.LIST ? h(t.GRID) : h(t.LIST);
|
|
49
|
-
},
|
|
50
|
-
iconColumnVariant:
|
|
51
|
-
} = e || {},
|
|
49
|
+
}, y = !f && a.items.length === 0, R = m && m.sortDropdownProps && d.filter((n) => n.type !== "multiSelect" && n.type !== "enum"), {
|
|
50
|
+
iconColumnVariant: g
|
|
51
|
+
} = e || {}, E = g && g === j.COLUMN, r = e == null ? void 0 : e.onSortChange, G = q(({
|
|
52
52
|
column: n,
|
|
53
|
-
direction:
|
|
53
|
+
direction: I
|
|
54
54
|
}) => {
|
|
55
55
|
M({
|
|
56
56
|
column: n,
|
|
57
|
-
direction:
|
|
57
|
+
direction: I
|
|
58
58
|
}), r == null || r({
|
|
59
59
|
column: n,
|
|
60
|
-
direction:
|
|
60
|
+
direction: I
|
|
61
61
|
});
|
|
62
|
-
}, [r]),
|
|
62
|
+
}, [r]), N = {
|
|
63
63
|
...e,
|
|
64
64
|
sortDescriptor: u,
|
|
65
|
-
onSortChange:
|
|
65
|
+
onSortChange: G
|
|
66
66
|
};
|
|
67
67
|
return /* @__PURE__ */ o(F, {
|
|
68
68
|
children: /* @__PURE__ */ o("div", {
|
|
69
69
|
ref: S,
|
|
70
|
-
className:
|
|
71
|
-
children:
|
|
72
|
-
onRefresh:
|
|
73
|
-
}) : /* @__PURE__ */
|
|
74
|
-
children: [/* @__PURE__ */ o(
|
|
70
|
+
className: w.container,
|
|
71
|
+
children: T ? /* @__PURE__ */ o(J, {
|
|
72
|
+
onRefresh: V
|
|
73
|
+
}) : /* @__PURE__ */ v(H, {
|
|
74
|
+
children: [/* @__PURE__ */ o(k, {
|
|
75
75
|
...m,
|
|
76
76
|
containerRef: S,
|
|
77
|
-
isIconColumnEnabled:
|
|
77
|
+
isIconColumnEnabled: E,
|
|
78
78
|
onSortDescriptorChange: M,
|
|
79
|
-
onViewModeClick:
|
|
80
|
-
onZoomLevelChange:
|
|
81
|
-
sortableColumns:
|
|
79
|
+
onViewModeClick: _,
|
|
80
|
+
onZoomLevelChange: D,
|
|
81
|
+
sortableColumns: R,
|
|
82
82
|
sortDescriptor: u,
|
|
83
83
|
viewMode: i,
|
|
84
84
|
zoomLevel: p
|
|
85
85
|
}), /* @__PURE__ */ o("div", {
|
|
86
|
-
className:
|
|
87
|
-
children: /* @__PURE__ */
|
|
86
|
+
className: w.contentContainer,
|
|
87
|
+
children: /* @__PURE__ */ v(z, {
|
|
88
88
|
children: [/* @__PURE__ */ o(s, {
|
|
89
|
-
condition:
|
|
89
|
+
condition: y,
|
|
90
90
|
children: /* @__PURE__ */ o(K, {})
|
|
91
91
|
}), /* @__PURE__ */ o(s, {
|
|
92
92
|
condition: i === t.LIST,
|
|
@@ -97,7 +97,7 @@ function go({
|
|
|
97
97
|
selectionMode: c ? "multiple" : "none",
|
|
98
98
|
zoomLevel: p,
|
|
99
99
|
...a,
|
|
100
|
-
...
|
|
100
|
+
...N
|
|
101
101
|
})
|
|
102
102
|
}), /* @__PURE__ */ o(s, {
|
|
103
103
|
condition: i === t.GRID,
|
|
@@ -116,6 +116,6 @@ function go({
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
Vo as MetadataView,
|
|
120
|
+
Vo as default
|
|
121
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1o9go_5{display:flex;flex-direction:column;height:100%;overflow:hidden}._contentContainer_1o9go_15{overflow:auto}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Item } from '@box/types';
|
|
2
|
+
export declare const generateLargeDataset: (count: number) => Item[];
|
|
3
|
+
export type UseInfiniteScrollDemoOptions = {
|
|
4
|
+
initialCount?: number;
|
|
5
|
+
batchSize?: number;
|
|
6
|
+
maxItems?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const useInfiniteScrollDemo: ({ initialCount, batchSize, maxItems, }: UseInfiniteScrollDemoOptions) => {
|
|
9
|
+
displayedItems: Item[];
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
hasNextPage: boolean;
|
|
12
|
+
handleGetNextPage: () => void;
|
|
13
|
+
};
|