@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 N, V as t } from "../../chunks/types.js";
2
- import { ActionBar as j } from "./components/action-bar/action-bar.js";
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 w, Fragment as H } from "react/jsx-runtime";
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 = "_container_nykl3_5", Q = "_contentContainer_nykl3_14", T = {
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 go({
35
+ function Vo({
36
36
  actionBarProps: m,
37
37
  columns: d,
38
38
  tableProps: e,
39
- hasError: V,
40
- onRefresh: g,
41
- initialViewMode: y = t.LIST,
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(y), [u, M] = l(void 0), [p, L] = l(0), S = U(null), D = () => {
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
- }, _ = !f && a.items.length === 0, k = m && m.sortDropdownProps && d.filter((n) => n.type !== "multiSelect" && n.type !== "enum"), {
50
- iconColumnVariant: I
51
- } = e || {}, R = I && I === N.COLUMN, r = e == null ? void 0 : e.onSortChange, E = q(({
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: v
53
+ direction: I
54
54
  }) => {
55
55
  M({
56
56
  column: n,
57
- direction: v
57
+ direction: I
58
58
  }), r == null || r({
59
59
  column: n,
60
- direction: v
60
+ direction: I
61
61
  });
62
- }, [r]), G = {
62
+ }, [r]), N = {
63
63
  ...e,
64
64
  sortDescriptor: u,
65
- onSortChange: E
65
+ onSortChange: G
66
66
  };
67
67
  return /* @__PURE__ */ o(F, {
68
68
  children: /* @__PURE__ */ o("div", {
69
69
  ref: S,
70
- className: T.container,
71
- children: V ? /* @__PURE__ */ o(J, {
72
- onRefresh: g
73
- }) : /* @__PURE__ */ w(H, {
74
- children: [/* @__PURE__ */ o(j, {
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: R,
77
+ isIconColumnEnabled: E,
78
78
  onSortDescriptorChange: M,
79
- onViewModeClick: D,
80
- onZoomLevelChange: L,
81
- sortableColumns: k,
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: T.contentContainer,
87
- children: /* @__PURE__ */ w(z, {
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
- ...G
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
- go as MetadataView,
120
- go as default
119
+ Vo as MetadataView,
120
+ Vo as default
121
121
  };
@@ -1 +1 @@
1
- ._container_nykl3_5{display:flex;flex-direction:column;overflow:hidden}._contentContainer_nykl3_14{overflow:auto}
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^12.76.2",